gpt4 book ai didi

css - 如何调整

之间的空间

转载 作者:太空宇宙 更新时间:2023-11-04 12:30:02 25 4
gpt4 key购买 nike

我正在尝试了解调整 <a> 之间空间的最佳方式元素和 <p>元素。

这是我为此制作的 CodePen:http://codepen.io/theclarkofben/pen/jEVWgz

我正在专门寻找调整红色和蓝色文本之间的空间。我不想调整蓝色段落文本之后或红色超链接文本之前的空间。

到目前为止我玩过line-height - 然而,在蓝色之后调整空间是不合适的。

我也玩过-webkit-margin-before -webkit-margin-after但至关重要的是,我正在寻找与跨浏览器兼容的东西。

感谢您的时间和帮助。

最佳答案

放置 margin-top: 0;, margin-bottom:0;padding-top:0; padding- bottom:0; 到选择器 a,p

您可以通过调整这些值来调整空间。

a {
color:red;
text-decoration:none;
}
p {
color:blue;

}
a, p{
padding-top:0; /* Here is the code I added */
padding-bottom:0;
margin-top: 0;
margin-bottom:0;
}
<h3>Blog Articles</h3>
<a href="http://blog.hubspot.com/blog/tabid/6307/bid/6126/The-Ultimate-Glossary-120-Social-Media-Marketing-Terms-Explained.aspx">The Ultimate Social Media Glossary</a>
<p>Found this and had to share</p>
<h4>Influencer Outreach And Management - 5 Easy Tips</h4>
<ul>
<li>Looking for influencers shouldn’t be hard - find the ones that like you already</li>
<li>Communicate openly, honestly, and frequently with your influencers</li>
<li>Know their worth and treat them with respect</li>
<li>Give some creative freedom - people believe people, not advertising</li>
<li>Finally and very important - don’t leave them hanging. If you run a campaign with influencers, make sure you keep in touch afterwards and nurture the relationship.</li>
</ul>

关于css - 如何调整 <a> 和 <p> 之间的空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27731532/

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