/    Sign up×
Community /Pin to ProfileBookmark

Div dropping or disappearing

I have a row of three divs, when the user zooms in or resizes the window the 3rd div can either disappear or drop down, how do I prevent this

[code=html].siteheader {
width: 100%;
height: 93px;
border-bottom: 2px #085394 solid;
white-space: nowrap;
overflow: hidden;
}

.headercolumn {
width: calc(100% / 3);
float: left;
}

.headercolumnright {
width: calc(100% / 3);
float: left;
display: table;
}

<div class=”siteheader”>
<div class=”headercolumn”>
<div class=”defaultpaddingtop defaultpaddingleft”>
<asp:ImageButton ID=”ibRFIDLogo” CssClass=”rfidlogo” runat=”server” AlternateText=”RFID Discovery Logo” ImageUrl=”/Images/RFiD_Discovery_Logo.jpg” OnClick=”ibRFIDLogo_OnClick” />
</div>
</div>
<div class=”headercolumn aligncenter”>
<p class=”companyline1 paddingtop25 defaultpaddingbottom”>Cambridge University Hospitals</p>
<p class=”companyline2″>NHS Foundation Trust</p>
</div>
<div class=”headercolumnright”>
<div id=”headerboxleft”>
<p class=”companyline1 paddingtop25 defaultpaddingbottom”>DARREN ROCKETT</p>
<p class=”companyline2″>Administrator</p>
</div>
<div id=”headerboxright”>
<div class=”defaultpaddingtop defaultpaddingright”>
<asp:ImageButton ID=”ibLogout” ImageUrl=”~/Images/log_out_64.png” OnClick=”ibLogout_OnClick” runat=”server” />
</div>
</div>
</div>
</div>

[/code]

to post a comment
CSS

5 Comments(s)

Copy linkTweet thisAlerts:
@Kevin2Jan 31.2017 — .siteheader {
width: 100%;
height: 93px;
border-bottom: solid 2px #085394;
display: table;
}

.siteheader div {
display: table-cell;
}

.siteheader &gt; div {
width: calc(100% / 3);
}
Copy linkTweet thisAlerts:
@rocky050371authorJan 31.2017 — Hi Kevin,

Do I then remove the float lefts from headercolumn and headercolumnright?

What does the greater than sign do?

.siteheader > div {
Copy linkTweet thisAlerts:
@Kevin2Jan 31.2017 — Do I then remove the float lefts from headercolumn and headercolumnright?[/QUOTE]
If you need to apply other styles to those DIVs, then yes -- remove all the floats. If the styles in your posted classes were the only reason for their existence you don't even need those classes. The styles I posted are a [I]replacement[/I] for your posted styles, not an [I]addition[/I].
What does the greater than sign do?[/QUOTE]
[B].siteheader > div[/B] targets DIVs having a parent element with [B]class="siteheader"[/B]. In other words this doesn't affect the "grandchildren" of that element.
Copy linkTweet thisAlerts:
@rocky050371authorFeb 01.2017 — Thanks Kevin, worked a treat
Copy linkTweet thisAlerts:
@Kevin2Feb 01.2017 — You're very welcome. Good luck!
×

Success!

Help @rocky050371 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...