<分区>
标签 javascript html css
<分区>
我有几个内联显示的按钮 <h3>
标签。全部<h3>
标签长度相等,但按钮的边缘仍未对齐。
我想对齐按钮的边缘,使其看起来很普通。
最佳答案
假设您的代码如下所示:
<h3>hello</h3><input type="button" value="hello"></br>
<h3>hello 2</h3><input type="button" value="wad adwadaw a"></br>
<h3>hello 4</h3><input type="button" value="1231245 5"></br>
<h3>hello 55</h3><input type="button" value="asdasdddd"></br>
那么css应该是:
h3{
width:100px;
display:inline-block;
}
input[type="button"]{
width:300px;
display:inline-block;
}
这是你想要的吗?
关于javascript - 在 HTML CSS 中对齐元素的边缘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23565774/