/    Sign up×
Community /Pin to ProfileBookmark

Floating divs overlap in Firefox with zoom

I am designing a simple two-column website with a full-width header and footer as follows.

#header{text-align: center;}

#sidebar{float: left; width: 20%;}

#content{float: right; width: 80%;}

#footer{clear:both;}

This works OK in both IE and Firefox at normal size; however, when I zoom in and the text becomes very large, IE retains the layout (the widths of #sidebar and #content expand and contract as I zoom in and out, because IE applies the percentages to the width of the page, which is dynamic), but in Firefox the sidebar text wraps into shorter lines and overlaps with the content (the widths of #sidebar and #content do not change as I zoom in or out, because Firefox applies the percentages to the width of the window, which is fixed). How can I make Firefox retain the proportions of #sidebar and #content relative to the page width (not the window width) as I zoom in and out, like IE does?

(Reducing the width of #sidebar or #content helps, but then the gap between them looks too wide at normal size.)

to post a comment
CSS

0Be the first to comment 😎

×

Success!

Help @murgatroyd 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 5.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...