|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
css and self-closing anchor tags
I'm encountering an issue using css to format html that uses self-closing anchor tags
ie <A name="risk" /> Since there are several bookmark links at the top, these anchors are spread throughout the page. My styles for anchors are as follows: a { font-weight: normal } .body a { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; line-height: 14px; font-weight: normal; color: 3878db; text-decoration:underline } PROBLEM: The text following each <a name> tag is inheriting the anchor style. This is the case until an acutal </a> tag appears in the code. Is there another solution besides changing the the self closing acnhor tag to a standard tag <a name="risk"> </a> Thanks! |
|
#2
|
|||
|
|||
|
By adding the attribute selector [href] to the a in your style rules, the style will only be applied to those <a> elements for which an href attribute is defined...
Code:
.body a[href] { allstylestuff }
Maybe this works for you? |
|
#3
|
|||
|
|||
|
This fix seems to work in Netscape -- but not in IE5 or IE6. It seems that IE is not recognizing anything about the .body a style when I add the [href] attribute to it. It looks like it ignores it and just delivers the default style.
Here is my style as it stands now: .body a[href] { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; line-height: 14px; font-weight: normal; color: 3878db; text-decoration:underline } Thank you very much for your reply! |
|
#4
|
||||
|
||||
|
I have found that all this talk about closing tags with /> is bs... it never works for me
![]() Just use the closing tag like you are supposed to do, and it will work fine. Why complicate things? |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > css and self-closing anchor tags |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|