Javascript 在HTML CSS中对齐元素的边
我有几个按钮,它们与Javascript 在HTML CSS中对齐元素的边,javascript,html,css,Javascript,Html,Css,我有几个按钮,它们与标记一起显示。所有的标签长度相等,但按钮的边缘仍然没有对齐 我想对齐按钮的边缘,使其看起来简单。假设您的代码如下所示: <h3>hello</h3><input type="button" value="hello"></br> <h3>hello 2</h3><input type="button" value="wad adwadaw a"></br> <h3>he
标记一起显示。所有的
标签长度相等,但按钮的边缘仍然没有对齐
我想对齐按钮的边缘,使其看起来简单。假设您的代码如下所示:
<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
<style type="text/css">
h3{
background:orange;
padding:10px 20px;
display:inline-block;
margin:0px
}
</style>
h3{
背景:橙色;
填充:10px 20px;
显示:内联块;
保证金:0px
}
HTML
主页
关于我们
接触
你应该提供截图或代码样本,以获得正确的答案
注意:如果按钮内容的宽度不同,则不可能具有相同长度的等边
向我们显示代码以帮助您。。我们猜不出所有的按钮都应该与文本对齐
<style type="text/css">
h3{
background:orange;
padding:10px 20px;
display:inline-block;
margin:0px
}
</style>
<h3>Home</h3>
<h3>About Us</h3>
<h3>Contact</h3>