CSS menu breaking into a new line

runelynx

I'm trying to use a CSS menu and everything seems to be working except the last 3 bullets are breaking off into a new line... and they should all be level. Any thoughts on what's going wrong? ((And... if you look at the live site here >> www.runic-paradise.com >> anyone know a way to stop the menu drop-downs from stretching the gray container box? :-/))

HTML:  

 <ul class="menu">
        <li class="green">
            <p><a href="#">Home</a></p>
            <p class="subtext">The front page</p>
        </li>
        <li class="yellow">
            <p><a href="#">About</a></p>
            <p class="subtext">More info</p>
        </li>
        <li class="red">
            <p><a href="#">Contact</a></p>
            <p class="subtext">Get in touch</p>
        </li>
        <li class="blue">
            <p><a href="#">Submit</a></p>
            <p class="subtext">Send us your stuff!</p>
        </li>
        <li class="purple">
            <p><a href="#">Terms</a></p>
            <p class="subtext">Legal things</p>
        </li>
    </ul>

CSS:

ul.menu{
    height: 50px;
    list-style: none outside none;
    margin: 0 auto;
    width: 500px;
}

/*li{
    width:100px;
    height:50px;
    float:left;
    color:#191919;
    text-align:center;
    overflow:hidden;
}*/

a{
    color:#FFF;
    text-decoration:none;
}

p{
    padding: 0px 5px;
}

    .subtext{
        padding-top:15px;
    }

ul.menu li{
    width:100px;
    height:50px;
    float:left;
    color:#191919;
    text-align:center;
    overflow:hidden;
}

/*Menu Color Classes*/
.green{
    background:#6AA63B url('images/green-item-bg.jpg') top left no-repeat;
}    
.yellow{
    background:#FBC700 url('images/yellow-item-bg.jpg') top left no-repeat;
}    
.red{
    background:#D52100 url('images/red-item-bg.jpg') top left no-repeat;
}    
.purple{
    background:#5122B4 url('images/purple-item-bg.jpg') top left no-repeat;
}    
.blue{
    background:#0292C0 url('images/blue-item-bg.jpg') top left no-repeat;
}
unconnected

I've opened your site in Chrome Dev Tools and found the following

<ul class="menu">
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <li class="green" style="overflow: hidden; height: 150px;">
... </li>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <li class="yellow" style="overflow: hidden; height: 50px;">
...

As I removed all this nbsp out of list elements menu went ok.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

CSS - breaking the element in place (no return to beginning of the line)

From Dev

Marquee - line breaking into two instead of a single line - css

From Dev

CSS force new line

From Dev

Prevent H1 tag from breaking to new line

From Dev

<br> not breaking onto new line, view source also displaying <br>

From Dev

Bootstrap 4.00 columns aren't breaking to new line

From Dev

CSS Vertical line for tree menu

From Dev

Simple Menu not starting on new line -- BootStrap

From Dev

Bootstrap nav menu going to new line

From Dev

Tooltip CSS: Remove new line

From Dev

CSS Animation behind a menu and tag line

From Dev

Zig Zag Line across menu buttons CSS

From Dev

CSS Animation behind a menu and tag line

From Dev

Keeping floating menu items in line? (CSS)

From Dev

UITextView breaking line to early

From Dev

How to display inline blocks without breaking them on new line when shrinking parent

From Dev

How to keep placing elements next to eachother without them breaking into a a new line, when they reach window widht?

From Dev

CSS scale in and out breaking

From Dev

css flexbox wrapping and breaking

From Dev

PHP breaking CSS layout

From Dev

CSS scale in and out breaking

From Dev

CSS Breaking Report

From Dev

css flexbox wrapping and breaking

From Dev

Is there an alternative to non-breaking space to put space in between text on a line in HTML/CSS?

From Dev

Css force new line in between text in content

From Dev

Div element not going to new line in css

From Dev

css relative positioning breaks div into new line

From Dev

CSS :after element being pushed to new line

From Dev

New line break overlaps previous text css

Related Related

HotTag

Archive