Free AdviceGet Free Advice
Home | Get advice | Give advice | Topics | Columnists | - !START HERE! -
Make Suggestions | Sitemap

Get Advice


Search Questions

Ask A Question

Browse Advice Columnists

Search Advice Columnists

Chat Room

Give Advice

View Questions
Search Questions
Advice Topics

Login

Username:
Password:
Remember me
Register for free!
Lost Password?

Want to give Advice?

Sign Up Now
(It's FREE!)

Miscellaneous

Shirts and Stuff
Page Backgrounds
Make Suggestions
Site News
Link To Us
About Us
Terms of Service
Help/FAQ
Sitemap
Contact Us


align code


Question Posted Monday April 21 2008, 12:52 pm

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

[ Answer this question ]
Want to answer more questions in the Technology category?
Maybe give some free advice about: Computers?


theymos answered Tuesday April 22 2008, 1:04 am:
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.

[ theymos's advice column | Ask theymos A Question
]


More Questions:

<<< Previous Question: Nicknames for her name!
Next Question >>> Pregnant?

Recent popular questions:
Want to give advice?

Click here to start your own advice column!

What happened here with my gamer friends?

All content on this page posted by members of advicenators.com is the responsibility those individual members. Other content © 2003-2014 advicenators.com. We do not promise accuracy, completeness, or usefulness of any advice and are not responsible for content.

Attention: NOTHING on this site may be reproduced in any fashion whatsoever without explicit consent (in writing) of the owner of said material, unless otherwise stated on the page where the content originated. Search engines are free to index and cache our content.
Users who post their account names or personal information in their questions have no expectation of privacy beyond that point for anything they disclose. Questions are otherwise considered anonymous to the general public.

[Valid RSS] eXTReMe Tracker