Background IMG in h1 tag issue, need...

User 2310615 Photo


Registered User
74 posts

hello,

i'm trying to use an background img using css on an h1 tag but i can't get it to display. here is my code

html

<h1 class="compId" > O&amp;M Metals, inc. </h1>

css

h1.compId {
width: 413px;
height: 63px;
background-image: url('../images/h1.png');
text-indent: -9999px;

}

am i doing something wrong?

thanks,
Jason Arroyo
User 122279 Photo


Senior Advisor
14,648 posts
Online Now

I guess you have the html file and the folder 'images' on the same level. If that is so, remove the ../ in front of the images in your url. If the html file and the image are in one subfolder each on the same level, the ../ must stay, of course.

I tried your code here, and it works fine for me.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 2310615 Photo


Registered User
74 posts

thank you! restarted HTML editor and for some reason it is now visible.
User 122279 Photo


Senior Advisor
14,648 posts
Online Now

'no' visible or 'now' visible? ;)

Yeah, I have also noticed that sometime you have to restart the odd programme to make things work.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com



Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.