[RESOLVED] help with text in java
Hi I have searched this in a few forums with no luck.
I am using a java script for day and time, what I am trying to do is change the color and to bold the text of that script.
I did try using css
Code:
<span id="date_time">
<script type="text/javascript">window.onload = date_time('date_time');</script>\
</span>
but no luck with that idea.
Can anyone steer me in the correct direction?
Thanks!
Re: help with text in java
First things first, Java and JavaScript are two different things and have basically nothing to do with each other.
As for your code, does that code actually end up displaying the current date and time within that span? I'm far from a JavaScript expert but, at first glance, I wouldn't have thought so.
As for bolding the text, how exactly did you try using CSS? Did you put a style attribute on the span? All else failing, would you not be able to simply put the <span> inside a <b>?
Re: help with text in java
Welcome to VBForums :wave:
Thread moved from the 'Java' forum to the 'XML, HTML, Javascript, Web and CSS' forum
Re: help with text in java
I think I mean Javascript... sorry javascript, Java and Css is all fairly new to me, and I was not very clear with my description.
I do have a .js file with all the main part of the javascript for the date and time, I then have the link portion of code in the head of my page and finally the code (posted above) in the body.
I then have the same for Css being, main .css file, link in the head and then where required throughout the body.
The date and time do appear just fine on all the pages they were meant to, I am just trying to adjust the font color and bold it due to some different backgrounds.
Just guessing and testing, I thought that I would be able to achieve this at the point of placement in the body tags by attaching a Css command to it.
I hope this makes things a little more clear.
Thanks again for any and all help. (I am now going to go and read up on the difference between Java and Javascript).
Re: help with text in java
The color and font style should be defined in the CSS file. You have given the span an ID of "date_time" so if you want special formatting for anything with that ID you must define that in the CSS file like this:
Code:
#date_time
{
font-weight: bold;
color: red;
}
Re: help with text in java
Ahhh, thank you!
This is what I had;
Code:
date_time { font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif;
color:#C00;
font-weight:bold
}
I missed the # sign.
Thanks so much!