2 replies [Last post]
dcaverman
dcaverman's picture
Offline
newbie
Last seen: 6 years 6 weeks ago
Timezone: GMT-5
Joined: 2014-05-28
Posts: 7
Points: 11

I have an image on the left and a floating div on the right with a menu in it. Everything is fine until I add some small text under the logo. When I do that my floating div moves below my main “Header” div. If I remove the <label> everything works fine. I’ve tried the text in a <div> instead of <label> but got the same results. Any suggestions?

<div class="Header">
            <div class="HeaderContent">
                <a href="Default.aspx"><asp:Image ID="imgLogo" ImageUrl="~/Images/CPI_logo.gif" AlternateText="CPI Logo" BorderWidth="0" runat="server" /></a><br />
                <label class="HeaderLogoText">Here is some text</label>
 
                <span class="HeaderMenu">
                    <Menu />
                </span>
            </div>
        </div>
 
 
 
.Header {
    background-color: #eeeeee;
}
 
.HeaderContent {
    width:1024px;
    text-align:left;
    margin:0 auto;
    border:0px solid red;
    padding:3px;
}
 
.HeaderLogoText {
    font-size:xx-small;
    color:#27b0e9;
}
 
.HeaderMenu {
    float:right;
    margin-top:40px;
}

//mod edit: Please read the instruction for posting code. Fixed ~gt

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 22 hours 2 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9761
Points: 3843

Place the floating element

Place the floating element before the other content.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

dcaverman
dcaverman's picture
Offline
newbie
Last seen: 6 years 6 weeks ago
Timezone: GMT-5
Joined: 2014-05-28
Posts: 7
Points: 11

Perfect! Thanks, I'll have

Perfect!

Thanks, I'll have to remember that for next time.