SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru Zygoma's Avatar
    Join Date
    May 2006
    Location
    York, Uk
    Posts
    916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Removing bullets CSS inheretance query

    Buon Giorno from 3 degrees C wetherby UK

    on this site http://tutorial.davidclick.com/mag.html i set out to remove the bullet styleing from the links. This ive done through playing around but I would like to know please why when trying to remove the bullet styleing this did not work:

    Heres the code:
    Code:
    .egg
    {
    position:absolute;
    top:0;
    right:500;
    z-index:50;
    }
    
    .title
    {
    position:absolute;
    top:50;
    right:300;
    z-index:100;
    background-color:#FFFFFF;
    }
    
    #container
    {
    margin: 0 auto;
    width:960px;
    border-width:5px;
    border-style:solid;
    border-color:red;
    padding:0;
    height:100%;
    position:relative;
    }
    
    #menu
    {
    float:right;
    list-style-type:none;
    }
    
    #menu a
    {
    text-decoration:none;
    }
    
    #menu li a:link
    {
    color:#000000;
    }
    
    #menu li a:hover
    {
    color:#C0C0C0;
    
    }

    Option 1 Did not work :-(

    #menu ul {
    float: right;
    list-style-type: none;
    }


    but this did


    Option 2 Did work but i cant see why :-(

    #menu {
    float: right;
    list-style-type: none;
    }

    I thought option 1 would work but i have a feeling i dont quite get the inhertence thing thats going on here. Any insights welcome :-)

    Grazie tnato,
    David
    I have had a perfectly wonderful
    evening, but this wasn't it-
    Julius "GROUCHO" Marx - 1890-1977
    http://www.davidclick.com

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,281
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    List-style is only passed from ol or ul elements to li elements. It can't be passed from an element that is not a list item or even one that is display:list-item but only from ul ,ol or li.

    Edit:


    oops - I missed that you were targetting the wrong element anyway as mentioned by Ron below. You don't have a ul inside #menu so #menu ul will not work.
    Last edited by Paul O'B; Feb 21, 2013 at 04:12.

  3. #3
    SitePoint Mentor bronze trophy
    ronpat's Avatar
    Join Date
    Jun 2012
    Location
    NJ, USA
    Posts
    2,457
    Mentioned
    61 Post(s)
    Tagged
    2 Thread(s)
    Your code suggests that this is not an issue of inheritance. Rather, it is an issue of targeting the correct element.


    The following line assigns the properties to a ul that is a child of an element with an id of "menu":

    #menu ul {properties}


    The following line assigns the properties to the element with an id of "menu", which presumably is a ul (because of the list-style-type property).

    #menu {properties}

  4. #4
    SitePoint Guru Zygoma's Avatar
    Join Date
    May 2006
    Location
    York, Uk
    Posts
    916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Brill thanks, your suggestsions have fixed the problem :-)
    I have had a perfectly wonderful
    evening, but this wasn't it-
    Julius "GROUCHO" Marx - 1890-1977
    http://www.davidclick.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •