CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 1st, 2003, 08:48 AM
Misto7 Misto7 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 2 Misto7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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!

Reply With Quote
  #2  
Old October 1st, 2003, 10:44 AM
jerom jerom is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Posts: 1,014 jerom User rank is Corporal (100 - 500 Reputation Level)jerom User rank is Corporal (100 - 500 Reputation Level)jerom User rank is Corporal (100 - 500 Reputation Level)jerom User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 17 h 34 m 25 sec
Reputation Power: 9
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?

Reply With Quote
  #3  
Old October 1st, 2003, 11:59 AM
Misto7 Misto7 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 2 Misto7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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!

Reply With Quote
  #4  
Old October 1st, 2003, 12:04 PM
Clone53421's Avatar
Clone53421 Clone53421 is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2003
Posts: 689 Clone53421 User rank is Private First Class (20 - 50 Reputation Level)Clone53421 User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 17 h 7 m 56 sec
Reputation Power: 6
Send a message via AIM to Clone53421
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?

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > css and self-closing anchor tags


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway