内联样式以覆盖列表项boostrap

时间:2019-12-29 20:18:55

标签: html css inline-styles

有人知道用我的个性化img覆盖列表中的img的那一行吗?

这行是我要更改的行:

<i class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i> Profile </a>

我尝试一下:

<i class="fas fa-user fa-sm fa-fw mr-2 text-gray-400" style="list-style-image: url('/images/myimg.jpg');"></i> Profile

但是没有用。有帮助吗?


不,它没有用。 I want to replace the icon at left with my icon.

“完整”代码为:

echo '<a class="dropdown-item" href="update-parameters.php">';
echo '<i class="fas fa-sm fa-fw mr-2 text-gray-400"></i>';
echo 'Profile';
echo '</a>';

由于验证条件而打印的html

1 个答案:

答案 0 :(得分:0)

这可能是您要寻找的

<ul>
    <li class="fas fa-user fa-sm fa-fw mr-2 text-gray-400" style="list-style-image: url('/images/myimg.jpg');">Profile</li>
</ul>