• HOME...">
    Geek Answers Handbook

    How to set the height of list items in HTML?

    Here is my code:

    HTML

    <div class="menu"> <ul> <li class="active"><a href="index.html">HOME</a></li> <li class="active"><a href="#">COMPANY</a></li> <li class="active"><a href="#">SOLUTIONS</a></li> <li class="active"><a href="#">SERVICES</a></li> <li class="active"><a href="#">NEWS & EVENTS</a></li> <li class="active"><a href="#">BLOGS</a></li> <li class="active"><a href="#">CONTACTS</a></li> </ul> </div> 

    CSS

     .header .menu ul { margin:33px 10px 0 0; padding:0; float:right; width:auto; height:12px; list-style:none;} .header .menu ul li { margin:0 4px; float:left;} 

    It does not recognize the height function. What for? How to set the height of a menu item?

    +7
    html css html-lists height
    nectar Jun 20 '10 at 19:35
    source share
    4 answers

    You are missing a semicolon :-)

    You can also try setting the line-height property for li tags to reposition the text in the element.

    +7
    scum Jun 20 '10 at 19:39
    source share
     .header .menu ul { margin:33px 10px 0 0; padding:0; float:right; width:auto;list-style:none;} .header .menu ul li { margin:0 4px; float:left;} .active{height:50px;} 
    0
    Babiker Jun 20 '10 at 19:48
    source share

    ul is set to 12 pixels high, at least in Firefox.

    0
    Patrick hendricks Jun 20 '10 at 19:54
    source share

    Is the height set to the correct item? You ask how to set the height of the menu item (presumably li ), but your CSS says that you set the height of ul . Perhaps moving height: 12px; can help height: 12px; from where it should .header .menu ul li .

    0
    Ryan kinal Jun 22 '10 at 17:25
    source share

    More articles:

    • Is there any way to see the source of the pcode (.p) file in MATLAB? - matlab
    • Jquery auto refresh div - jquery
    • JdbcTemplate and inet data type - postgresql
    • how to open p-code matlab file - file
    • Compare Two NSDates - Cocoa
    • Gradle oily beam _ leaving_ META-INF from baby cans? - gradle
    • Large open source Java applications and libraries - java
    • Is there a str_replace equivalent in C ++? - c ++
    • Where can I find this Unicode character? - user-interface
    • Code Execution Speed: IronPython vs C #? - ironpython

    All Articles

    Geek Answers | 2019