user6133
user6133

Reputation: 117

Two Column html, how do i move a column?

I have two columns, floated left and right, like so:

<div style="float: left;">
text1
</div>
<div style="float: right;">
text 2
</div>

but how can i move the right column a little bit to the LEFT? with 'padding'? how to?

or if i use this, how can i move the column on the right it a little bit to the RIGHT?

<div style="float: left;">
text1
</div>
<div style="float: left;">
text 2
</div>

Upvotes: 1

Views: 15106

Answers (2)

pcsi
pcsi

Reputation: 604

You can try this instead:

<div style="float:left; padding-right:-30px;">

or

<div style="float:left; padding-right:30px;">

Hope it helps!

Upvotes: 0

secretformula
secretformula

Reputation: 6432

You can change the css style to do it try the following

<div style="float: left; position: relative; left: 30px">

This changes the positioning to relative and then you move the box based on what it's original position was.

Upvotes: 2

Related Questions