如何在按钮的中心添加两行
有一个带有边框的按钮:3PX实心#E82929;哪些技术可以用来添加照片中的其他行?
.btn {
position: relative;
width: 362px;
height: 71px;
color: #FFFFFF;
background-color: #000000;
border: 3px solid #E82929;
font-family: 'Flamenco';
font-style: normal;
font-weight: 400;
font-size: 24px;
line-height: 25px;
text-align: center;
}
<button class="btn">Забронировать столик</button>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用梯度
Use gradient
您不需要额外的标记,因为可以使用 :: 和
:: After
伪元素。假设您在左右2行应具有
30px
的宽度和10px
的左右填充,您可以将其添加到已经存在的CSS:根据您的需要更改宽度和填充。
它的作用是:它添加
:: /code>
and 伪元素在左右没有文本内容,并垂直定位它们。
如果您对详细信息有任何疑问,请随时提出。
You do not need extra markup, because it can be done with the
::before
and::after
pseudo elements.Assuming your 2 lines at the left and right should have a width of
30px
and a left and right padding of10px
, you could add this to your already existing CSS:Change the width and padding according to your needs.
What it does: It adds the
::before
and::after
pseudo elements with no text content on the left and right and positions them vertically centered.If you have any questions regarding details, feel free to ask.