/    Sign up×
Community /Pin to ProfileBookmark

bleeding <div>

Hi, first post here. I couldn’t find a solution by searching, so here is my problem:

I have a page with several div’s in each other. Trouble appears when one div contains a lot of text. In IE it shows ok, but in Mozilla the div “bleeds” through the main design.

I have a sketch of it: [IMG]http://strang.endofinternet.net/div/bleed.gif[/IMG]

The CSS is as follows:

[CODE]
div#wrapper {
width: 800px;
border-right: 1px solid #d0d0d0;
border-bottom: 1px solid #d0d0d0;
}

div#maincontents { /* ie can see me */
margin: 10px 0 10px 0;
padding: 40px 0 10px 15px;
width: 785px;
height: 424px;
}
head:first-child+body div#maincontents { /* ie can’t see me */
height: 0%;
min-height: 424px;
height: auto;
}
div#mainsquare { /* ie can see me */
float: left;
border: 1px solid #d0d0d0;
width: 543px;
height: 380px;
padding: 10px 20px 10px 10px;
}
head:first-child+body div#mainsquare { /* ie can’t see me */
height: 0%;
min-height: 380px;
height: auto;
}
div#imagesquare {
float: right;
width: 170px;
height: 195px;
margin-right: 15px;
border: 1px solid #d0d0d0;
}
div#newssquare {
float: right;
width: 170px;
margin-right: 15px;
margin-top: 8px;
min-height: 195px;
height: 195px;
border: 1px solid #d0d0d0;
background-color: #fff;
}
[/CODE]

Is there a solution to this problem. First I had trouble getting IE to understand that I needed a min-height of the squares, and now this in Mozilla…

to post a comment
CSS

9 Comments(s)

Copy linkTweet thisAlerts:
@TimeBanditApr 19.2004 — What do you want to happen? You have all your heights and widths specced. If there's too much text it has to go somewhere, either boxes get bigger, or they bust out of where you want them, or you get scrollbars in areas. Which do you want?

BTW, If you're designing for 800x600, do not make your outer DIV 800. People have all kinds of junk in their browsers eating up that space.

[URL=http://hotwired.lycos.com/webmonkey/99/41/index3a_page2.html?tw=design]designing for various resolutions[/URL]
Copy linkTweet thisAlerts:
@DaveSWApr 19.2004 — If you have a div with a definite height and overflow: auto then that may solve your problem.

And by junk TimeBandit means little things like scrollbars and favourites columns...
Copy linkTweet thisAlerts:
@prsauthorApr 19.2004 — I realize I wasn't too precise in my question... :o

What I want is for the [I]wrapper[/I] and [I]maincontents[/I] to follow the [I]mainsquare[/I]. I've set a minimum-height because the [I]maincontents[/I] has a background-image.

In Internet Explorer the wrapper and maincontents follows mainsquare as it grows, but in Mozilla it doesn't. I don't want to hav eny scrollbars inside the page, but if that's what it takes to get the page working, I suppose I have no choice.

The problem seems to be that I have two div's floating to the right and the mainsquare-div floating to the right...

DaveSW: which div should have overflow: auto. I think I tried it with no luck.
Copy linkTweet thisAlerts:
@DaveSWApr 19.2004 — I think the best solution would be for you to give us the html as well as the css. Either zip up the full file set, or upload them. Then we could work out the answer properly rather than guessing.

Regards

Dave
Copy linkTweet thisAlerts:
@prsauthorApr 19.2004 — Ok, I've uploaded the page to:

http://strang.endofinternet.net/div/


About the 800 width, I'll be taking 30 pixels off of that to make it work, but this is still a work-in-progress.
Copy linkTweet thisAlerts:
@DaveSWApr 19.2004 — Looking at it I think you need an empty element at the bottom of the page with clear: both in it.

<p style="clear: both">&amp;nbsp</p>

This should be inside the bottom of the div that isn't stretching.
Copy linkTweet thisAlerts:
@prsauthorApr 19.2004 — [i]Originally posted by DaveSW [/i]

[B]Looking at it I think you need an empty element at the bottom of the page with clear: both in it.



<p style="clear: both">&amp;nbsp</p>



This should be inside the bottom of the div that isn't stretching. [/B]
[/QUOTE]


Wow, thanks. That was simple ?

What a relief. Thank you just doesn't seem enough... ?


/Patrick
Copy linkTweet thisAlerts:
@DaveSWApr 19.2004 — LOL ?

It's caught me out a few times too, but it's quite logical when you think it through!

You can use that space to insert a footer as well.
Copy linkTweet thisAlerts:
@TimeBanditApr 20.2004 — [i]Originally posted by DaveSW [/i]

[B]And by junk TimeBandit means little things like scrollbars and favourites columns... [/B][/QUOTE]


You got it! ?

FYI, I think the current "safe" 800x600 design size is 744x410, something like that. but I think we do actually use a slightly different size. Now *that's* living on the edge!
×

Success!

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