Search code examples
htmlcssinline-styles

inline-styles for override a list item boostrap


Does someone know the single line for override an img in a list with my personalized img?

The line is this one that i want to change:

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

I try with this:

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

But it didn't work. Some help?


no it didn't work. I want to replace the icon at left with my icon.

The 'complete' code is:

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>';

the html it's printed because is verified a condition


Solution

  • This might be what you're looking for

    <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>