gpt4 book ai didi

css - 如何将文本与 css 形状对齐

转载 作者:行者123 更新时间:2023-11-28 07:59:33 25 4
gpt4 key购买 nike

页面在这里:

http://www.satearn.com/node/163

我希望文本与 css 形状完美对齐,就好像它们是子弹一样。

.big_bullets {
display: inline-block;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
position: relative;
cursor: pointer;
top: 0;
padding: 0 19px;
border: 3px solid rgb(255,255,255);
-webkit-border-radius: 50px;
border-radius: 50px;
font: normal normal bold 20px/50px Arial, Helvetica, sans-serif;
color: rgb(255, 255, 255);
text-align: center;
text-transform: uppercase;
-o-text-overflow: clip;
text-overflow: clip;
background: #069;
float:left;
}

.big_bullets_para {
float:right;
clear: both;
margin-right:50%;
}

HTML 看起来像这样:

    <div class="big_bullets">
A</div>

<div class="big_bullets_para">
<p>
Please use the site's shopping cart and use Paypal or credit card options.</p>
</div>

<p>&nbsp;</p>

<div class="big_bullets">
A</div>

<div class="big_bullets_para">
<p>
Please use the site's shopping cart and use Paypal or credit card options.</p>
</div>

<p>
&nbsp;</p>

<div class="big_bullets">
A</div>

<p>
&nbsp;</p>

<div class="big_bullets_para">
<p>
Please use the site's shopping cart and use Paypal or credit card options.</p>
</div>

最佳答案

只需将html结构更改为

<div class="big_bullets_para">
<div class="big_bullets">A</div>
<p>Please use the site's shopping cart and use Paypal or credit card options.</p>
</div>

JSFiddle demo here .

如果您希望段落与元素符号点的顶部对齐,请使用

.big_bullets_para p {
margin: 0;
}

关于css - 如何将文本与 css 形状对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29865082/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com