Jump to content

simple boxes next to each other


dazz_club

Recommended Posts

Hi Guys,I would like to align these square boxes to eachother on the same line, but i dont know what position to use or the ones i have used dont work?At present one is on top of the other and i would like them to be side by side next to eachother.any pointers?heres the code below if it helps

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>test css sheet</title><style type="text/css"><!--#box {height:100px;width: 100px;border: 1px solid #FFF;background-color:#FFFF00;}#box2 {height:100px;width: 100px;border: 1px solid #FFF;background-color:#CCC;right: auto;}--></style></head><body><div id="box"></div><div id="box2"></div>test</body></html>

Link to comment
Share on other sites

You could have your first box floated left and then your box2 have a margin left of a bit more than the size of your box1.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...