|
align code what is the code so i can align BOTH sides of my myspace about me section, so both sides are lined up.. not just the left or right. thank you
[ ] Want to answer more questions in the Technology category? Maybe give some free advice about: Computers?
If you do something like this:
<div style="float:left">Left content</div>
<div style="float:right">Right content</div>
It will make two content columns that are lined up. Further, you can ensure that they are the exact same size by setting a width:
<div style="float:left;width:100px">Left content</div>
<div style="float:right;width:100px">Right content</div>
And you can put them right next to each other by putting them in another div which combines their real width:
<div style="width:200px">
<div style="float:left;width:100px">Left content</div>
<div style="float:right;width:100px">Right content</div>
</div>
If you use any kind of borders, padding, or margins for the divs, like this:
<div style="float:left;width:100px;border:1px solid black;padding:1px;margin:1px">
Then you will have to take into account the box model when figuring out the real width:
[Link](Mouse over link to see full location)
Example of taking the box model into account:
<div style="width:207px">
<div style="float:left;width:100px;border:1px solid black;padding:1px">Left content</div>
<div style="float:right;width:100px;border:1px solid black;border-left:none;padding:1px">Right content</div>
</div>
I had to add up the widths of the actual elements(100+100=200), the borders(2+1=3), and the padding(2+2=4) to come up with 207. ]
More Questions: |