Header image

T

tshad

I have a page that has the following in my css file that I got from somewone
else:

/**************************************************************

Header Image/Flash Movie

**************************************************************/

#headerImg {

margin: 0 auto;

height: 143px;

background: url(../images/bg/header_image.jpg) no-repeat top left;

}



This doesn't seem to be set anywhere in my code but if I change the name to
#headerImg - the picture doesn't show. What causes it to display? It isn't
part of a class or set on the pages anywhere.

Thanks,

Tom
 
J

John Hosking

tshad said:
I have a page that has the following in my css file that I got from somewone
else:
#headerImg {
margin: 0 auto;
height: 143px;
background: url(../images/bg/header_image.jpg) no-repeat top left;
}

This doesn't seem to be set anywhere in my code but if I change the name to
#headerImg - the picture doesn't show.

I don't know what you mean here. Isn't #headerImg what you already have
in the CSS? I don't see any difference.
What causes it to display? It isn't
part of a class or set on the pages anywhere.

Can you provide us with a URL, so that we may look for ourselves?
 
D

dorayme

"tshad said:
I have a page that has the following in my css file that I got from somewone
else:

/**************************************************************

Header Image/Flash Movie

**************************************************************/

#headerImg {

margin: 0 auto;

height: 143px;

background: url(../images/bg/header_image.jpg) no-repeat top left;

}



This doesn't seem to be set anywhere in my code but if I change the name to
#headerImg - the picture doesn't show. What causes it to display? It isn't
part of a class or set on the pages anywhere.

If you change what name where and why?
What causes it to display? It isn't
part of a class or set on the pages anywhere.

It happens like this:

If there is rectangle actually displayed (and not empty and therefore of
no width) by something like

<p id="headerImg">...</p>

in the body of your HTML and the image is in the directory one level up
from the HTML doc and in a folder called bg which in turn is in a folder
called images, it will appear in the background.
 
J

Jukka K. Korpela

tshad said:
I have a page that has the following in my css file that I got from
somewone else:

You're asking for trouble, especially if you have no clue of what the css
file "does".
/**************************************************************

Header Image/Flash Movie

**************************************************************/

Yet another proof for Korpela's first law of comments: Comments are worse
than useless. This is not just pointless babble, it is also grossly
misleading, since the css code quoted has nothing to do with movies, Flash
or other.
#headerImg {

margin: 0 auto;

height: 143px;

background: url(../images/bg/header_image.jpg) no-repeat top left;

}

This violates the first law of sensible use of css: if you set any of
content color, background color, and background image, set them all.
This doesn't seem to be set anywhere in my code

Fine. Get rid of the garbage css then.
but if I change the
name to #headerImg - the picture doesn't show. What causes it to
display? It isn't part of a class or set on the pages anywhere.

Sense your talk makes not.
 
R

richard

I have a page that has the following in my css file that I got from somewone
else:

/**************************************************************

Header Image/Flash Movie

**************************************************************/

#headerImg {

margin: 0 auto;

height: 143px;

background: url(../images/bg/header_image.jpg) no-repeat top left;

}



This doesn't seem to be set anywhere in my code but if I change the name to
#headerImg - the picture doesn't show. What causes it to display? It isn't
part of a class or set on the pages anywhere.

Thanks,

Tom

The image will not display unless named properly. #headerImg is not a
name for the image, it is an identifier for the css properties for
that particular item. The # means "ID". Somewhere on the page you will
find a corresponding item with an attribute of ID="headerImg".
If it were marked as .headerImg then you would see class="headerImg".
Changing any part of the actual file name without doing so to the
existing file name in that folder will cause nothing to happen.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top