Jump to content

DOCTYPE preventing CSS border wrapping <div> tags


Archdeacon

Recommended Posts

I have the 2 'div' columns (side by side) in another 'wrapper' 'div' but cannot get the 'border' to wrap around the whole thing - it just forms a small box border across the page, about 1em deep!. However, if I remove the DOCTYPE line below it all works! What should I use instead please? I cant get this entered properly - the DOCTYPE line has gone; sorry.""

Link to comment
Share on other sites

keep the doctype, and fix your markup/css. how, you ask? as stated, we'll never know unless we can see what your code is.

Link to comment
Share on other sites

I have included the basics of the HTML file here, assuming that theses tages work now.body { border: 0px;margin: 0px;padding: 0px; color: black; background: blue;margin-left: 7%;margin-right: 7%;}#box { border:solid;border-width: thin;width:98%;} #leftbox {display:inline;float:left;width:47%; }#rightbox {display:inline;float:right;width:47%;}<p id="box">

Link to comment
Share on other sites

Sorry if anything is missing again from the above, but I enclosed it all in 'PRE' tags, but all of the CSS code is there. The 'Box' is the 'div' id that includes 'leftbox' and 'rightbox'. Both IE9 and Firefox will not wrap the border correctly unless the Doctype line is removed.

Link to comment
Share on other sites

??? if it is the div 'id', Why is it applied to paragraph element? Just guessing here, but the floated elements area WHATEVER they are, will not be detected by the outer container, but! by applying overflow: hidden; to the outer container #box should fix this.

Link to comment
Share on other sites

all I see is CSS and one HTML element. could you please post the entire code? (in code tags) edit: yeah, as said, it probably because you are using floats

Link to comment
Share on other sites

I cant get the code tags to work properly. That 'p' id thing was put there by this posting. Give me a while and I will see what I can do, but there is a wrapper 'div' tag containing 2 others, one id=leftbox and the other id=rightbox.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...