开发者

how to spread out buttons, they are currently stacked?

I have a bunch of buttons on my page, my html is like:

<div>
  <input ..>
  &开发者_如何学JAVAlt;input ...>
</dvi>

They are currently just stacking up on each other, I want them all on one horizontal line spread out.

I tried doing:

display:inline

on the outer div, but that didn't work.


Try display:inline or float:left on the inputs.


Try:

div input {
    float: left;
    margin-right: 10px;
}

... or something similar. You could give the inputs classes or IDs (which is generally recommended) so you can apply specific styles to each one.


Did you say you applied inline to the div? That sets the div to display inline, but I think what you want is for the inputs to display inline. try:

div input {
display: inline;
}

Better?


Just float them!

<div>
   <input style="float: right" />
   <input style="float: right" />
</div>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜