html - prevent div's from taking 100% width -
<div style="position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px;"> <div style=" border: 2px solid black; margin: 0 auto; text-align: center; padding: 3px;"> hello<br />hola </div> <div style=" border: 2px solid black; margin: 0 auto; text-align: center; padding: 3px;"> sentence </div> </div>
i have problem: borders of inner div's reach on whole width of page, want them frame content inside them. if use: display: inline
borders frame each line separately , overlap, doesn't work - can help?
p.s style's aren't declared in original document in stylesheet
assign width absolutely positioned element? if you're looking shrink-wrapping, float:left
or display:inline-block
perfect that.
Comments
Post a Comment