【发布时间】:2017-08-20 18:56:23
【问题描述】:
我想要一个类似这样的按钮:
但这是我的:
这是 CSS:
.cubutton {
border-radius: 99999px; /* Round button corners here with border-radius */
background-color: #44ace8;
color: #fff;
cursor: pointer;
font-family: 'Quicksand', sans-serif;
font-size: 20px;
font-size: 2.0rem;
font-weight: 700;
letter-spacing: 1px;
padding: 20px 40px 20px 40px;
margin-left: auto;
margin-right: auto;
margin-top: 25px;
margin-bottom: 25px;
text-transform: uppercase;
-webkit-font-smoothing: antialiased;
-webkit-box-shadow: 4px 4px 5px 0px rgba(50, 50, 50, 0.75); /* Adds drop shadow to button. */
-moz-box-shadow: 4px 4px 5px 0px rgba(50, 50, 50, 0.75);
box-shadow: 4px 4px 5px 0px rgba(50, 50, 50, 0.75);
-webkit-transition: all 0.1s ease-in-out;
-moz-transition: all 0.1s ease-in-out;
-ms-transition: all 0.1s ease-in-out;
-o-transition: all 0.1s ease-in-out;
transition: all 0.1s ease-in-out;
}
对于我的生活,我无法弄清楚为什么填充和边距不显示。我无论如何都不是编码专家,所以我很容易忽略一些明显的东西。
这是html:
<a data-sumome-listbuilder-id="11553d26-bca5-4975-91e8-e5fdf2937bf8"
class="cubutton" data-sumome-trigger="true"
href="javascript:void(0);">Take this post with you. Get the PDF version. 100% free. Click here.</a>
【问题讨论】:
-
如果字体大小为 20 像素,这些填充看起来分别为 20 和 40 像素。试试增加?还是您希望按钮更窄?
-
什么是 HTML?
-
根据新的 HTML 更新了我的答案。