|
-
Oct 16th, 2012, 07:59 PM
#1
Thread Starter
New Member
[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!
-
Oct 16th, 2012, 08:26 PM
#2
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>?
-
Oct 17th, 2012, 04:27 AM
#3
Re: help with text in java
Welcome to VBForums 
Thread moved from the 'Java' forum to the 'XML, HTML, Javascript, Web and CSS' forum
-
Oct 17th, 2012, 04:51 AM
#4
Thread Starter
New Member
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).
-
Oct 17th, 2012, 05:26 AM
#5
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;
}
-
Oct 17th, 2012, 05:41 AM
#6
Thread Starter
New Member
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!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|