 |
Javascript How-To Ask your "How do I do this with Javascript?" questions here. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

July 7th, 2004, 10:33 AM
|
Authorized User
|
|
Join Date: Oct 2003
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
set text color
I would like to set the color on this to white. [u]I have tried the following but it didn't work</u>. I would like to stay away from using the Close Window tags.
<div style="text-align: right color: white;"><a href='javascript:top.close()'>Close Window</a></div>
Rudy
__________________
Rudy
|

July 7th, 2004, 11:10 AM
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hi Rudy,
You need a ";" between "right" & "color"...
text-align: right; color: white;
HTH,
Chris
|

July 7th, 2004, 11:23 AM
|
Authorized User
|
|
Join Date: Oct 2003
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Chris
I tried both of these and still it didn't change the color.
<div style="text-align: right; color: white"><a href='javascript:top.close()'>Close Window</a></div>
<div style="text-align: right; color: white;"><a href='javascript:top.close()'>Close Window</a></div>
Rudy
|

July 7th, 2004, 11:35 AM
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hey Rudy,
Sorry, been a long day. That'll be the style of your a tag overriding it, try...
Code:
<div style="text-align: right;"><a style="color: white;" href="#">myLink</a></div>
Cheers,
Chris
|

July 7th, 2004, 11:56 AM
|
Authorized User
|
|
Join Date: Oct 2003
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Yes, Chris that worked.
For browser compatiblity concerns is the syntax on this correct, seems a bit strange
Code:
<div style="text-align: right;"><a style="color: white;" <a href='javascript:top.close()'>Close Window</a></div>
Rudy
|

July 7th, 2004, 12:00 PM
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hi Rudy,
No, you only need one a tag...
Code:
<div style="text-align: right;">
<a style="color: white;" href="javascript:top.close()">
Close Window
</a>
</div>
Best regards,
Chris
|

July 7th, 2004, 12:14 PM
|
Authorized User
|
|
Join Date: Oct 2003
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks Chris,
I didn't think the way I had it was right. It did work with the extra (a) tag in IE, but some browsers may not have overlooked it. I'm very new to some of this. Thanks for your help and patience - I have it right now.
Rudy
|

July 7th, 2004, 12:27 PM
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hi Rudy,
IE is far too forgiving!!!
Just in case you wanted to play with hover styles etc, this may be of use...
Code:
<style type="text/css">
#CloseLink{
text-align: right;
}
#CloseLink a{
color: white;
}
#CloseLink a:hover{
color: blue;
}
</style>
...
<div id="CloseLink">
<a href="javascript:top.close()">
Close Window
</a>
</div>
Best regards,
Chris
|

July 7th, 2004, 12:33 PM
|
Authorized User
|
|
Join Date: Oct 2003
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Yes Chris, that's just the kind of CSS code I'm looking for. This should look good on the very plain links I have now.
I just started learning and reading about CSS.
Got anymore of this great code I would love to see it.
Thanks again :)
Rudy
|

July 8th, 2004, 01:01 AM
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Dear in CSS links are define like this
a.decor6:link {color: #ffffff; text-decoration: none}
a.decor6:visited {color: #ffffff; text-decoration: none}
a.decor6:hover {
text-decoration: underline;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
color: #ffffff;
Love 4 all
|
|
 |