Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jan 2009
    Posts
    160
    Thanks
    40
    Thanked 1 Time in 1 Post

    Question adding margin to second level of list

    I am having trouble adding a margin to the second level of a list shouldnt this work? everything in the list is a link

    Code:
    <style type="text/css">
    <!--
    .list li a{
    
    	font-size:12px;
    	font-variant:small-caps;
    	font-family:Arial, Helvetica, sans-serif;
    }
    
    .list li a:hover {
    	
    	font-size:12px;}
    	
    .list ul li a{
    	
    	margin-left:15px;}	
    -->
    </style>

  • #2
    Regular Coder
    Join Date
    Apr 2008
    Posts
    685
    Thanks
    15
    Thanked 105 Times in 104 Posts
    I think you might have got your selectors wrong, what does the HTML for this CSS look like?

    As a random guess I think you might be needing something like:

    .list li li a{} or .list li ul a{}

  • #3
    met
    met is offline
    Regular Coder
    Join Date
    Oct 2009
    Location
    United Kingdom
    Posts
    728
    Thanks
    4
    Thanked 119 Times in 119 Posts
    you want

    ul.list li ul li { } /*applied to second level LI */


    this may help visualise it better
    Code:
    ul { background:red; }
    ul li { margin-left:10px; background:blue;}
    ul li ul { background:yellow; }
    ul li ul li { margin-left:20px; background:green; }


  •  

    Posting Permissions

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