Results 1 to 2 of 2

Thread: css linebreak

  1. #1
    Join Date
    Feb 2009
    Posts
    87

    css linebreak

    I'm working with a suckerfish menu. I expanded the submenu to 100% width of its parent (the main menu category title), but if I have a very long menu title and 2 short submenu links, they stay on one line rather than breaking to two.

    I've tried display:block; on the links within the list. If I break the line in HTML the second link aligns to the right (no float:rights in the the code). The li's themselves have to be display:none rather than block elements so that they can be hidden until hovered. any ideas? here's my nav css

    Code:
    #mainnav a{
    font-size:13px;
    text-decoration:none;
    padding:4px 12px 4px 12px;
    display:block;
    color:#FFF;
    }
    
    
    
    ul { /* all lists */
    	padding: 0;
    	margin: 0;
    	list-style: none;
    	background-color:#342d2d;
    
    }
     
    li { /* all list items */
    	float: left;
    	position: relative;
    	
    	
    }
     
    li ul { /* second-level lists */
    	display: none;
    	position: absolute;
    	top: 5px;
    	left: 0;
    	width:100%;
    	clear:both;
    	
    }
    
     
    li>ul { /* to override top and left in browsers other than IE, which will position to the top right of the containing li, rather than bottom left */
    	top: auto;
    	left: auto;
    }
     
    li:hover ul, li.over ul { /* lists nested under hovered list items */
    	display: block;
    }
    	
    
    #mainnav li li a {
    	font-size:11px;
    	float:left;
                    display:block;
    	}
    
    
    #mainnav li li a:hover {
    	color:#FFFF00;
    	}

  2. #2
    Join Date
    Dec 2009
    Posts
    1,232
    IS it live online to view?

Posting Permissions

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