div.menu
{
background-image: url(images/menubg.png);
background-repeat: no-repeat;
}
This is the code I use to give a div a background but it isn't working yet when I replace the div.menu
with "body" it works fine so it isn't the code that is wrong what is it with div tags they seem to take twice as much time to code. What is going wrong with this tag anyone know. Can you tell me whay I'm doing wrong.
Div tags so far to me are like Windows "what works today may not work tommorow."
Thanks for any help.
It is still ignoring the commands here is what I have now (everything)
CSS Sheet
main.css
#menu
{
background-image:url('images/menubg.png');
background-repeat: no-repeat;
}
HTML Body (search.htm)
<div id="menu"></div>
Right my CSS sheet is within a folder called CSS
so in my head section I include this.
<link rel="stylesheet" href="css/main.css" type="text/css" />
but it is still ignoring the commands. I know my css file is connected to the html sheet as like mentioned if i switch it to the body not a div it works. Does this have anything to do with the doc tag at the top. I have mine shown below.
<!DOCTYPE html>
other than that I don't know everyone else is using the same code fine.
Thanks you two guys got it working like the bottom guy mentioned it was because a height was not declared. I'll have to remember that one for future notes.
Thanks to you both for your help
{
background-image: url(images/menubg.png);
background-repeat: no-repeat;
}
This is the code I use to give a div a background but it isn't working yet when I replace the div.menu
with "body" it works fine so it isn't the code that is wrong what is it with div tags they seem to take twice as much time to code. What is going wrong with this tag anyone know. Can you tell me whay I'm doing wrong.
Div tags so far to me are like Windows "what works today may not work tommorow."
Thanks for any help.
It is still ignoring the commands here is what I have now (everything)
CSS Sheet
main.css
#menu
{
background-image:url('images/menubg.png');
background-repeat: no-repeat;
}
HTML Body (search.htm)
<div id="menu"></div>
Right my CSS sheet is within a folder called CSS
so in my head section I include this.
<link rel="stylesheet" href="css/main.css" type="text/css" />
but it is still ignoring the commands. I know my css file is connected to the html sheet as like mentioned if i switch it to the body not a div it works. Does this have anything to do with the doc tag at the top. I have mine shown below.
<!DOCTYPE html>
other than that I don't know everyone else is using the same code fine.
Thanks you two guys got it working like the bottom guy mentioned it was because a height was not declared. I'll have to remember that one for future notes.
Thanks to you both for your help