I have some titles layouts in my css file, like h1 and h2. Sometimes I need a simple title like: <h1>Most readed</h1> and some times I need to add an image to the begining of the title like:
. How can I do this using a class, like <h1 class="with_image_1">?
I have some titles layouts in my css file, like h1 and h2. Sometimes
Share
The best way of doing this would be to set the image as the
background-imageand add padding to move the text out of the way, so assuming your image is 50 px wide:You can then mess with the padding and the image placement to get everything lined up nicely