css - Div taking all horizontal space -


why? dint speficy width, should big content inside it.

#swfbox {  padding: 10px 10px 10px 10px;  margin: 50px auto 0px;  background: #310600;  border: 3px solid #4b0900; } 

i have centered , load swf files in it, work have set width width of swf file, bad since every file has different width.

<div> elements block-displayed elements, means default 100% width unless otherwise specified.

if want element expand based on content, might want try setting display property on <div> inline (or use span since it's inline-div).

edit:

i guess inline didn't work quite way expected, learned today. you're going want instead set display: inline-block, comes it's own set of problems.

first, according quirks mode page display property, ie6 , ie7 support inline-block on elements natural display: inline means need use <span> elements rather <div> elements.

second, inline-block has own set of quirks should read on before using it, prevent being surprised further "gotchas". this page has pretty write-up on inline-block.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -