Adjust divs in div
I have a div and 5 divs in it.
<div style="width: 1000px">
<div style="float: left; width: 50px;"></div>
<div style="float: l开发者_StackOverflow中文版eft; width: 50px;"></div>
<div style="float: left; width: 50px;"></div>
<div style="float: left; width: 50px;"></div>
<div style="clear: both;"></div>
</div>
Now i want to adjust the inner divs to the right.
Try giving the parent div a padding-left, as such:
<div style="width: 1000px;padding-left:100px">
<div style="float: left; width: 50px;"></div>
Or you can try positioning each element by their own, with margin-left:
<div style="width: 1000px;">
<div style="float: left; width: 50px;margin-left:100px"></div>
Some resources:
http://www.w3schools.com/css/css_margin.asp
http://www.w3schools.com/css/css_padding.asp
Give the parent div a padding-left: 50px
insert whatever size you want.
If you want them centered, put them in another div, and center that div inside the original parent.
精彩评论