<a> tags in CSS

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
fried
Forum Newbie
Posts: 16
Joined: Tue Sep 08, 2009 5:43 am

<a> tags in CSS

Post by fried »

pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: Posting Code in the Forums to learn how to do it too.


I inherited this piece of code which works fine in Firefox, however in IE it doesn't show the link at all. I'm sure it's a syntax problem but I've validated both this and the HTML. If it helps I'll post the HTML. Thanks.

Code: Select all

a.info {
    position: relative;
    color: #000;
    text-decoration: none;
    font-size: 10px;
 
}
 
a.info span {
 
   display: none;
 
}
 
a.info:hover {
    background: none;
    z-index: 500;
    color: #F30;
 
}
 
a.info:hover span {
    text-align: center;
    display: inline;
    position: absolute;
    white-space: nowrap;
    top: -20px;
    left: 20px;
    background: #777777;
    color: #FFFFFF;
    padding: 3px;
    border: 1px solid #1ca1cd;
    border-left: 5px solid #1ca1cd;
    overflow: visible;
}

pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: Posting Code in the Forums to learn how to do it too.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: <a> tags in CSS

Post by pickle »

Hard to tell without seeing a screenshot or something. I'd suggest taking out all the definitions but the first one & see if that fixes it. If it does, add the second definition back & check, then the third, etc, until you find what/why it's not showing up.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: <a> tags in CSS

Post by social_experiment »

Could you please paste the html code pertaining to this. I guesstimated from your style sheet what the html should look like and if it is like the following :

Code: Select all

<span><a class="info" href="#">Link</a></span>
it displays no problems in I.E 7.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Re: <a> tags in CSS

Post by daedalus__ »

well it doesn't display because the text is wrapped in the span tag and the span tag is set to display none.

you need to strip the unnecessary attributes from the a class. you probably shouldn't have a class called info anyway.

if you post the markup and css that is pertinent to the problem ill fix it after i make you understand what the problem is.
:)
Post Reply