The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Page Content outside <body> problem
Brad364
post Sep 6 2007, 09:01 PM
Post #1





Group: Members
Posts: 4
Joined: 6-September 07
Member No.: 3,735



Using CSS, I put a red dashed border around my <body> tag. Within the HTML body I have one <div> (black border) that has two sub-<div>'s within it (green and blue borders)

I put dashed borders on each of the three <div>'s.

See My Webpage

Can any one tell me how come the content of one of the <div>'s (blue) is rendered outside the <body> ?

Interesting note: As I expand the content in the green <div> it's border expands as does the red body div border. But the green div seems to be aloof of the body and its parent black div.

Problem occurs in both FF and IE7.


Thanx in advance.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Sep 15 2007, 02:25 AM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,737
Joined: 9-August 06
Member No.: 6



Hi! Sorry for the late reply. I think everyone managed to overlook your post. blush.gif

The menu hangs out from BODY because it's floated. Floats take up no space, hence don't make the box they are contained in expand. BODY isn't larger than its content and since floats don't take up any space, they don't add to the height of that content.

There's an image that illustrates this behavior at the end of this section in the spec.
http://www.w3.org/TR/CSS2/visuren.html#floats
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Sep 15 2007, 03:06 AM
Post #3


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



Incidentally, the text in your menu is too wide (with my current settings) for the box it's in, so CSS helpfully hides some of it. One does wonder quite what the "conceivers" of CSS were smoking.

The general principle seems to be "fail-dangerous".
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Sep 15 2007, 03:27 AM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,737
Joined: 9-August 06
Member No.: 6



QUOTE(Brian Chandler @ Sep 15 2007, 10:06 AM) *

Incidentally, the text in your menu is too wide (with my current settings) for the box it's in, so CSS helpfully hides some of it.


Only if you tell it to.

CODE

#container {
  background-color: #FFFEF0;
          overflow: hidden;
          width: 900px;
          border: dashed black 1px;



QUOTE
One does wonder quite what the "conceivers" of CSS were smoking.

Maybe they thought people would actually read what they wrote... wink.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Sep 15 2007, 04:26 AM
Post #5


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



QUOTE
QUOTE(Brian Chandler @ Sep 15 2007, 10:06 AM) *

Incidentally, the text in your menu is too wide (with my current settings) for the box it's in, so CSS helpfully hides some of it.


Only if you tell it to.


Uh, no. If the designer of the page tells it to. I think this means that in any situation in which there may be lines too long to wrap (which in a properly fail-safe design would mean everywhere), the CSS "overflow: hidden" specification is not usable.

QUOTE

QUOTE
One does wonder quite what the "conceivers" of CSS were smoking.

Maybe they thought people would actually read what they wrote... wink.gif


Look, these poor muddled souls couldn't write anything clearly to save their lives (try finding out what "absolute" means in their dialect of Norwegian by the normal process of looking at the spec), so reading what they wrote doesn't help too much.

What, out of curiosity is "floats don't take up any space" supposed to mean? Do you know what it would mean if it were English? (I'm guessing you're quoting from the Norwegian.)


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 14th June 2024 - 07:14 PM