Forum Moderators: not2easy

Message Too Old, No Replies

Displaying just an image in a div

         

king1028

4:08 pm on Mar 3, 2005 (gmt 0)



I am trying to display just an image in a div tag. this is what I have for my css page:

body{
padding-right: 0px; padding-left: 0px; padding-bottom: 0px; padding-top: 0px; margin: 0px; background: #363734; font: xx-small verdana, arial, helvetica, sans-serif; voice-family: inherit;
}
h1 {
background-position: left top; margin: 0px; background-repeat: no-repeat; font-size: xx-small;
}
h1 span {
display: none;
}
#container {
align: center; position: relative; top: 0px; width: 700; height: 100%;
}

#header {
background-image: url(/images/header.jpg); no-repeat position: absolute; left: top; height: 224;
}

and this is my html code for the divs:

<link rel="stylesheet" type="text/css" href="mainStyles.css">
<body>
<div id=container>
<div id=header><h1><span>headerImage</span></h1></div>
</div>
</body>

When trying to view it in a brower all I get is the background color of #363734 showing up. Why is this?

I am still fairly new to css so be gentle on me.

Thanks

createErrorMsg

4:54 pm on Mar 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



#header {
background-image: url(/images/header.jpg); no-repeat position: absolute; left: top; height: 224;
}

...should be...

#header {
background: url(/images/header.jpg) no-repeat; height: 224px;
}

cEM