开发者

how to spread out buttons, they are currently stacked?

开发者 https://www.devze.com 2023-01-31 03:05 出处:网络
I have a bunch of buttons on my page, my html is like: <div> <input ..> &开发者_如何学JAVAlt;input ...>

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

精彩评论

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

关注公众号