/    Sign up×
Community /Pin to ProfileBookmark

body not stretching

Hey guys I have a dumb question. I have a webpage that has the following css applied to the html and body:

[CODE]
html, body
{
width:100%;
padding:0px;
margin:0px;
}
[/CODE]

I have a <div> container within the body tag that is stretching vertically to the right of the visible area of the web browser and the body tag isn’t stretching along with it. The div tag is not positioned absolute so I don’t understand why the body tag wouldn’t stretch with it. Any insight?

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@toicontienApr 22.2009 — You are setting the width of the <body> tag, and it will not stretch beyond that width. If all you are doing is setting the width of the <body> tag, you don not need to even set it:
[CODE]body {
margin: 0;
padding: 0;
}[/CODE]


That's all you should need.
Copy linkTweet thisAlerts:
@hobeauauthorApr 22.2009 — hmm i tried that, didn't seem to help. any more ideas?
Copy linkTweet thisAlerts:
@toicontienApr 22.2009 — Can you post a link to the page or the full HTML and CSS? The <body> tag should be expanding to fit the contents if you do not give it a width.
×

Success!

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