Removing underlines from Links not working in FF

Discussion in 'CSS' started by electron, Oct 25, 2007.

  1. #1
    I have used the following code for removing underlines from link :
    Works fine on IE but in FF it still shows the underlines.
    CSS related to links :
    
    .uline{text-decoration:none;}
    a:link{color:#ff33cc;}
    a:visited{color:#ff33ff;}
    a:hover{color:#999999;}
    
    Code (markup):
    html code :
    
    <ul type="none">
    	<li><a href="#"><span class="uline">First</span></a></li>
    	<li><a href="#"><span class="uline">Second</span></a></li>
    	<li><a href="#"><span class="uline">Third</span></a></li>
    </ul>
    
    Code (markup):
    TIA
     
    electron, Oct 25, 2007 IP
  2. Pammer

    Pammer Notable Member

    Messages:
    3,417
    Likes Received:
    397
    Best Answers:
    0
    Trophy Points:
    260
    #2
    hmmm i wonder it is, check again.. you are with new firefox version ?
     
    Pammer, Oct 25, 2007 IP
  3. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #3
    Try that. By the way, where the hell did you get "type="none"" from?
     
    soulscratch, Oct 25, 2007 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #4
    For starters, you need to remove type="none" from the unordered list since it's not a valid HTML attribute.

    Second, if you want to remove the underlines from the list links, either target all links in lists or give the list either a class or ID and target them directly.

    
    ul a {
        text-decoration: none;
    }
    
    .classname a {
        text-decoration: none;
    }
    
    #idname a {
        text-decoration: none;
    }
    
    Code (markup):
    Do that and you won't even need the spans. Just make sure that if you use a class or ID, that the selector matches the attribute value in the list.
     
    Dan Schulz, Oct 25, 2007 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #5
    and that if you are going to use a SPAN or DIV with a class, that you can't just apply the styling of that class to a parent container instead of wasting the extra tag... or that you even need a class in the first place (which a lot of times you don't)
     
    deathshadow, Oct 25, 2007 IP
  6. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I meant the class on the list itself, Jason.
     
    Dan Schulz, Oct 25, 2007 IP
  7. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #7
    I wasn't commenting on what you posted - I was commenting on the original code and adding to what you posted.
     
    deathshadow, Oct 25, 2007 IP
  8. electron

    electron Well-Known Member

    Messages:
    249
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #8

    I got the type="none" thing from here : http://www.w3schools.com/css/tryit.asp?filename=trycss_list-style-type

    Well, it works as well(both IE & FF), i wanted to get rid of the list dots & it did exactly that.:confused:

    I have been trying to learn HTML | CSS for some weeks now and it is anything but easy with all the browser variations, exceptions, bugs and what not.
    So if anything works for both FF & IE i take it as the rule.:rolleyes:

    Thanks for helping me out again :)

    Have fun this weekend ;)
    Mine just started with Friday being a Institute holiday
     
    electron, Oct 25, 2007 IP
  9. tomcairns

    tomcairns Guest

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    the type="none" should be in your css:

    Edit: I put list-style-type instead of list-style :)
     
    tomcairns, Oct 25, 2007 IP
  10. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I personally use the short-hand version, list-style: in my stylesheet.
     
    Dan Schulz, Oct 25, 2007 IP