Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Sep 2014
    Posts
    1
    Member #
    40222

    Horizontal CSS Menu displaying Vertically in IE

    Hi guys,

    I'm pretty new to this and would really appreciate some help - I've made a horizontal menu bar using CSS and it works in Chrome but when I test it in IE it is displayed vertically and also doesn't show any of my CSS.

    My HTML:

    <div id="menu">
    <ul>
    <li><a class="active" href="index.html"><b>Home</b></a></li>
    <li><a href="Services.html"><b>Services</b></a></li>
    <li><a href="Supplements.html"><b>Supplements</b></a></li>
    <li><a href="About.html"><b>About</b></a></li>
    <li><a href="Contact.html"><b>Contact</b></a></li>
    </div>

    My CSS:

    ul{
    width: 96%;
    float: left;
    margin: 0;
    padding: 0px;
    list-style: none;
    text-align: center;
    font-size: larger;
    }
    li{
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    padding-left: 7%;
    padding-right: auto;
    padding-top: 2%;
    float: left;
    }
    ul li a{
    text-decoration: none;
    font-family: sans-serif;
    color: white;
    text-align: center;
    padding: 29px;
    padding-bottom: 34px;
    overflow: hidden;
    }
    ul li{
    display: inline-block;
    }
    ul li a:hover{
    background-color: #D5CBEB;
    color: black;
    font-family: sans-serif;
    }
    .active{
    color: black;
    border-radius: 0px 0px 0px 0px;
    background-color: #D5CBEB;
    overflow: hidden;
    }
    #menu{
    width: 100%;
    height: 84px;
    border: 0px solid;
    border-radius: 30px 30px 0px 0px;
    background: url(../images/bg1.png);
    display: inline-block;
    text-align: center;
    }

    At the head of my page I have:
    <!DOCTYPE HTML>

    If anyone has any ideas I would be so grateful, I am designing this site for a customer and thought I was ready but now realise I have a looooong way to go.

    Please help me through this!

  2.  

  3. #2
    Senior Member sasha_bolcina's Avatar
    Join Date
    Sep 2014
    Location
    Serbia
    Posts
    274
    Member #
    40099
    Liked
    47 times
    There are confusing things in css. And it's easy to confuse IE. I can't test your code now.
    Why do you need display block inline? LI is already block element and you need it float left. That's all. I would also remove "auto" margin, as they are used to center blocks. If you want to center text inside LI, use text-align: center.

  4. #3
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    Inline block has the same effect in this case as floating them left. Old versions of IE don't support it though.
    Last edited by Ronald Roe; Sep 30th, 2014 at 10:53 AM.

  5. #4
    Banned
    Join Date
    Sep 2014
    Posts
    21
    Member #
    40215
    Liked
    1 times
    hi,
    horizantal menu is
    <li>home</li>
    <li>about</li>
    <li>contact</li>

    css:
    ul li{display inline :block;}

  6. #5
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    Should be
    display:inline-block
    Last edited by Ronald Roe; Oct 01st, 2014 at 05:01 AM.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 07:37 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com