Currently, I have a basic CSS menu that includes background images aligned to the left. My goal is to have the text float to the left of each image as well.
<div class='mmenu'><ul><li><a id="li6" class="menu-news" href= "viewNews.php" >News</a></li></ul></div>
The CSS code for this menu is as follows:
.mmenu{
height: fit-content;
width: fit-content;
float: left;
position: fixed;
}
.mmenu ul
{
margin-top: 20px;
margin-left: 15px;
}
.mmenu li
{
margin-bottom: 0px;
width: 150px;
color: white;
}
.mmenu a {
font-size:14px;
font-family: Arial, sans-serif;
font-style: normal;
font-weight:bold;
display: block;
padding-top:12px;
padding-bottom: 7px;
text-align:left;
padding-right: 12px;
padding-left: 15px;
position: relative;
}
.menu-news{
background-image:url('menu icons/css-sprite.png');
background-repeat: no-repeat; background-position:5px 17px;
}
One issue I am facing is that the menu text appears above the image. How can I create space between the image and the text?