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

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -