On Sat 03 Dec 2011 01:54:38 PM PST, wsg@webstandardsgroup.org wrote:
*********************************************************************
WEB STANDARDS GROUP MAIL LIST DIGEST
*********************************************************************


From: "Stevio"<redea...@freeuk.com>
Date: Sat, 3 Dec 2011 02:42:02 -0000
Subject: Content div sticking out the side of container div

Somehow I do not seem to have come across this problem before. I have two
divs, one contained within the other. If the viewport of the browser is
resized to be smaller than the contents of the inner div, the inner div
sticks out the side of the outer container div, which continues to resize
with the browser.

Surely the outer div should stop shrinking when it reaches the width of its
inner div, even if the viewport continues to be shrunk?

How can I fix this so that the outer div will not become any smaller than
the width of its inner div, when the width of the inner div will be unknown?

Here is example code that illustrates this. In my example, the inner div is
set to a fixed width, but for the web site I am developing, I will not know
the width of the inner div.


<!DOCTYPE html>
<html><head><title>Test</title>
<style type="text/css">
#wrap {
background:#CCC;
border:2px solid blue;
}
#contents {
width: 800px;
background:#99F;
border:2px solid yellow;
}
</style>
</head>
<body>
<div id="wrap">
Test
<div id="contents">test</div>
Test
</div>
</body>
</html>


Thanks,
Stephen


*********************************************************************
From: "Greg Gamble"<gsga...@comcast.net>
Date: Fri, 2 Dec 2011 18:51:15 -0800
Subject: RE: [WSG] Content div sticking out the side of container div


Outer Div has a fixed width.

-----Original Message-----
From: li...@webstandardsgroup.org [mailto:li...@webstandardsgroup.org] On
Behalf Of Stevio
Sent: Friday, December 02, 2011 6:42 PM
To: Web Standards Group
Subject: [WSG] Content div sticking out the side of container div

Somehow I do not seem to have come across this problem before. I have two
divs, one contained within the other. If the viewport of the browser is
resized to be smaller than the contents of the inner div, the inner div
sticks out the side of the outer container div, which continues to resize
with the browser.

Surely the outer div should stop shrinking when it reaches the width of its
inner div, even if the viewport continues to be shrunk?

How can I fix this so that the outer div will not become any smaller than
the width of its inner div, when the width of the inner div will be unknown?

Here is example code that illustrates this. In my example, the inner div is
set to a fixed width, but for the web site I am developing, I will not know
the width of the inner div.


<!DOCTYPE html>
<html><head><title>Test</title>
<style type="text/css">
#wrap {
background:#CCC;
border:2px solid blue;
}
#contents {
width: 800px;
background:#99F;
border:2px solid yellow;
}
</style>
</head>
<body>
<div id="wrap">
Test
<div id="contents">test</div>
Test
</div>
</body>
</html>


Thanks,
Stephen



*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
*******************************************************************



**************************************************************
Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
**************************************************************




Try using overflow, or perhaps max-width.

--
Regards
~~~~~~~~~~~~~~~~
Alan C Whiteman | Visualis Web Design
(562) 305-2862  | http://visualiswebdesign.com


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
*******************************************************************

Reply via email to