嗨,我正在使用以下 css 创建自定义按钮
.myBlackButton02 {
-moz-box-shadow:inset 0px -3px 7px 0px #6a6f76;
-webkit-box-shadow:inset 0px -3px 7px 0px #6a6f76;
box-shadow:inset 0px -3px 7px 0px #6a6f76;
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #61656c), color-stop(1, #292b2e));
background:-moz-linear-gradient(top, #61656c 5%, #292b2e 100%);
background:-webkit-linear-gradient(top, #61656c 5%, #292b2e 100%);
background:-o-linear-gradient(top, #61656c 5%, #292b2e 100%);
background:-ms-linear-gradient(top, #61656c 5%, #292b2e 100%);
background:linear-gradient(to bottom, #61656c 5%, #292b2e 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#61656c', endColorstr='#292b2e',GradientType=0);
background-color:#61656c;
-moz-border-radius:3px;
-webkit-border-radius:3px;
border-radius:3px;
border:1px solid #040405;
display:inline-block;
cursor:pointer;
color:#ffffff;
font-family:Tahoma;
padding:9px 23px;
text-decoration:none;
text-shadow:0px 1px 0px #263666;
}
.myBlackButton02:hover {
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #292b2e), color-stop(1, #61656c));
background:-moz-linear-gradient(top, #292b2e 5%, #61656c 100%);
background:-webkit-linear-gradient(top, #292b2e 5%, #61656c 100%);
background:-o-linear-gradient(top, #292b2e 5%, #61656c 100%);
background:-ms-linear-gradient(top, #292b2e 5%, #61656c 100%);
background:linear-gradient(to bottom, #292b2e 5%, #61656c 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#292b2e', endColorstr='#61656c',GradientType=0);
background-color:#292b2e;
}
.myBlackButton02:active {
background:transparent;
}
我正在使用的html是
<div id="d1" style="height:46px;top:0px;left:0px;right:0px;" class="heading01" >
<div id="d2" class="style1" style="position:absolute;left:10px;top:4.5px;color:#FFF;">Heading</div>
<div align="right" style="padding-top:2.5px;padding-right:10px;">
<button class="myBlackButton02" style="font-size:10pt;outline:none;"> x </button>
<button class="myBlackButton02" style="font-size:10pt;outline:none;"> x </button>
<button class="myBlackButton02" style="font-size:10pt;outline:none;">
<img src="icons/extensions/right_16.png" style=""/>
</button>
</div>
标题01的CSS是
.heading01{
background: rgb(69,72,77); /* Old browsers */
background: -moz-linear-gradient(top, rgba(69,72,77,1) 0%, rgba(0,0,0,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(69,72,77,1)), color-stop(100%,rgba(0,0,0,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#45484d', endColorstr='#000000',GradientType=0 ); /* IE6-9 */
}
我得到的是
但我想要的是所有按钮都处于相同的垂直高度。我知道有办法做到这一点,但我不知道怎么做。所以任何帮助将不胜感激。我什至尝试通过将图像设置为背景图像但渐变变为纯色,甚至尝试使用 div 但它与图像相同。谢谢