/    Sign up×
Community /Pin to ProfileBookmark

Floating div ignoring its contents.

I could swear CSS is out to get me…

I’ve got a page here [url]http://home.stephenphilbin.com/[/url] that I’ve been trying to get to behave (without a mountain of messy CSS and markup) for ages now. I decided to drop what I had before and just go with a simplified setup. All I’m not trying to do is have the header, content and footer divisions inside the main_data division and to float the main data division to the left so that the additional_data division (the one with the large “S” logo and small form) would sit to the right of the main_data division.

From the looks of what I’ve got and the experience with CSS I’ve had, I’d say that the main_data division is floating left and so bringing the additional_data division up to its right side, but it’s collapsing to a width of zero because it’s ignoring its contents. I seemed to remember putting a clear:both; on a div as the last element of a float made it stop ignoring its contents and behave in a sensible way, but it doesn’t seemed to have worked here.

Anyone know how to fix this? It’s getting right on my chesticles.

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@FangJun 25.2007 — Add [I]clear:both;[/I] to [I]#additional_data [/I]
×

Success!

Help @Stephen_Philbin 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.17,
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,
)...