|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Another CSS Question
In the top of my document, using PHP, I included a php file that contains a style sheet.
The style sheet is the following: <style type="text/css"> a:link {text-decoration:none;color:#ffffff;} a:visited {text-decoration:none;color:#ffffff;} a:hover {text-decoration:underline;color:#ff0000;} </style> This should make all of my links white with no underlines, the visited ones are white with no underlines, and when the cursor hovers over the link it should be red and underlined. This works great. My problem is, there is an area of the website that has a white background. This poses a problem if there is a hyperlink on the page, because it would be impossible to see the white hyperlink on a white background. To get around this problem, I have added this declaration to any link on that white background: <p style=font-size: 10pt; color: black> This too, works great, except that because it is a <p> break, it moved my link down to the next line, which is annoying. Example: This is my sample <a href=link.htm><p style=font-size: 7pt; color: black>link</p></a> Gives the result: This is my sample link I would much rather it all be on the same line. Do you follow? Is that confusing enough? Any help? ![]() |
|
#2
|
|||
|
|||
|
Create a new style definition, either of the following would do:
The following class can be applied to any element: .special {color:#000000;text-decoration:none;} This one can only be applied to <a> elements: a.special {color:#000000;text-decoration:none;} Then assign the class to your <a> tags: <a class="special">....</a> Another alternative would be to use <span> tags rather than <p> tags. Yet another alternative would be to add the inline style def. to your <a> tag rather than a <p> tag: <a href="#" style="color:#000000;text-decoration:none;">.....</a> Whatever you do, check it across different browsers and platforms as compliance with the css specification is sketchy. |
|
#3
|
||||
|
||||
|
UHH
But classes wont work for NS, or am I wrong?
![]() |
|
#4
|
|||
|
|||
|
Classes work in netscape, unless you're talking about some 3.x version. Granted, they sometimes behave oddly, but they work.
Check out http://www.webreview.com/style/css1...astergrid.shtml for support details. |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > Another CSS Question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|