2 replies [Last post]
Caposoft
Caposoft's picture
Offline
Enthusiast
Last seen: 7 years 26 weeks ago
Timezone: GMT+1
Joined: 2008-03-16
Posts: 330
Points: 118

Hi,

I just solved a positioning problem, and was asking myself if that was the correct or semantical way to solve it, or if any issues might occur.

The issue: I have 2 div in the contents div. The 2 div are aligned horizontally left and right. The left div is not an issue since the text-align: left in the content div makes it automatically dock on the left side. The right div is floated left and moved to left with a margin value.

As I said, I solved it, I would just appreciate if someone could give me a thumbs up or down.

The CSS looks like that:

#contents { width: 920px; margin: 0 auto; padding-top: 20px; }

#form
{
width: 410px;
margin: 10px 0 0 0;
padding: 10px 0 0 0;
background-color: #EEF9D8;
}

#utilities
{
float: right;
width: 200px;
margin: 10px 300px 0 0;
padding: 10px 0 0 0;
}

The HTML:

jessnoonyes
Offline
newbie
Last seen: 14 years 18 weeks ago
Joined: 2008-03-29
Posts: 3
Points: 0

If it works then great! I

If it works then great! I would have just floated the left div to the left, and right div to the right.

Caposoft
Caposoft's picture
Offline
Enthusiast
Last seen: 7 years 26 weeks ago
Timezone: GMT+1
Joined: 2008-03-16
Posts: 330
Points: 118

Thank you

Thank you, and you are right, both have to be floated to their side. The CSS I posted somehow missed the float: left for #form. Well, if it is a thumbs-up way of doing it I am satisfied.