I have the following:
<li><a class='disabled' ><img src='../../Content/Icons/home.png' />Home</a></li>
My li height is 25px and my img is 16x16. What I would like to do is to make the image line up with the text and also have a small space between the image and text. I tried the following:
img { padding-top: 6px; margin-right: 4px; }
The image moves down but the text moves down as well.
Is there a way I could just add padding or margin to the image without the text moving?
Please note that I already use set (and change) the background color so I need to use the img tag.
In your document, select the object with which you want to work, switch to the “Layout” menu, and then click the “Position” button. That button also appears on the “Format” menu of the Ribbon and works the same way. The Position drop-down menu is divided into two sections: “In Line With Text” and “With Text Wrapping.”
You can use:
img {
margin-right: 4px;
position: relative;
top: 6px
}
That will move only the img
down 6px
from where it would have been.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With