MacMan
MacMan

Reputation: 933

DIV Layout and positioning

I'm struggling to position a input button and then form field to the right of a DIV.

You can see the basic layout here : http://jsfiddle.net/qk0jp5pt/

body { background-color:#C0C0C0; }
#page { width: 80%; margin: 30px auto; padding: 0; border: 1px solid #800000 }   
#row { width: 80%; border: 1px solid #FF0000; }                                                                                                                                                                   
#table { width: 80%; border: 1px solid #00FF00 }

The #row is the div I'm trying to align. It's border is red and I'd like to move the input button the right inside of that DIV.

Ultimately I'd like to add an input text field and have them both aligned to the right with in #row. http://jsfiddle.net/qk0jp5pt/1/

Can someone advise what I'm doing wrong !

Thanks

Upvotes: 0

Views: 43

Answers (2)

Unkn0wn
Unkn0wn

Reputation: 88

You Can Use Float for div content or inputs.


    float: right;

Upvotes: 0

Alex
Alex

Reputation: 7374

Adding:

text-align: right;

to #row does the trick

http://jsfiddle.net/qk0jp5pt/2/

Upvotes: 1

Related Questions