我试图让我的按钮具有相同的宽度,但由于某种原因,它不工作。需要为了做什么,以确保所有按钮符合这些期望的结果?:HTML5 - 按钮宽度不一样
- 所有按钮都必须具有相同的宽度
- 所有按键不能使用页面
具有相同的宽度
/*File download button*/
.buttonFileDownload_container {
text-align: center;
margin-bottom: 20px;
}
.buttonFileDownload {
display: inline-block;
position: relative;
padding: 10px 60px;
background-color: transparent;
border: 3px solid black;
color: black;
text-decoration: none!important;
font-size: 1.5em;
line-height: 1.2;
text-align: center;
text-indent: 15px;
}
.buttonFileDownload:before,
.buttonFileDownload:after {
content: ' ';
display: block;
position: absolute;
left: 10px;
top: 52%;
}
/* Download box shape */
.buttonFileDownload:before {
width: 20px;
height: 4px;
border-style: solid;
border-width: 0 4px 4px;
}
/* Download arrow shape */
.buttonFileDownload:after {
width: 0;
height: 0;
margin-left: 6px;
margin-top: -140px;
border-style: solid;
border-width: 8px 8px 0 8px;
border-color: transparent;
border-top-color: inherit;
animation: downloadArrow 2s linear infinite;
animation-play-state: paused;
}
.buttonFileDownload:hover:before {
border-color: black;
}
.buttonFileDownload:hover:after {
border-top-color: black;
animation-play-state: running;
}
/* keyframes for the download icon anim */
@keyframes downloadArrow {
/* 0% and 0.001% keyframes used as a hackish way of having the button frozen on a nice looking frame by default */
0% {
margin-top: -14px;
opacity: 1;
}
0.001% {
margin-top: -30px;
opacity: 0;
}
50% {
opacity: 1;
}
100% {
margin-top: 0;
opacity: 0;
}
}
<p>Hello World</p>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Numbers</u><br/>
Numbers description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Colours</u><br/>
Colours description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Onomatopoeia</u><br/>
Onomatopoeia description</a>
</div>
<div class="buttonFileDownload_container">
<a href="#" class="buttonFileDownload"><u>Alphabet</u><br/>
Alphabet description</a>
</div>
@MacaronLover您可以使用百分比或宽度宽度 – Rob