添加填充到:css中的伪元素之前

前端之家收集整理的这篇文章主要介绍了添加填充到:css中的伪元素之前前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
任何人都知道如何在:before伪元素和内容实际开始的位置之间添加填充?
<ul>
    <li><strong>Name Surname</strong></li>
    <li>+27.082.555.4155</li>
</ul>

我只希望第一个li有一个子弹点,并且只有它有一个强大的元素.

我已经使用了:

.fr_contactInformation ul li strong:before
{
    content:url(/App_Themes/2011/images/hm_listImage.gif);
}

.fr_contactInformation ul li strong
{
    /*Here is where I am going wrong*/
    padding-left: 50px;
}

谢谢大家!

解决方法

你可以在之前填充填充,以在它和元素之间留出空间
.fr_contactInformation ul li strong:before
  {
      content:url(/App_Themes/2011/images/hm_listImage.gif);
      padding-left:50px;
   }

猜你在找的CSS相关文章