Here's what I'm trying to achieve:
1. A <div>, centered on screen, 600px wide and 100px high, with a
background-image (also 600 x 100).
2. Text (an <h1> element) positioned with precision inside the <div>, on
the image.
3. A similar result in IE and FF...
Here's some of the XHTML:
<body>
<div id="container" >
<div id="top">
<h1>Title</h1>
</div>
...
</div>
</body>
Here are selected parts of my CSS:
body {
text-align: center;
...
}
#container {
width: 600px;
...
margin-right: auto;
margin-left: auto;
...
padding: 0px;
}
#top {
width: 600px;
height: 100px;
background-image: url('banner.png ');
...
padding: 0px;
}
#top h1 {
...
}
I can't figure out how to position the text in '#top h1'. I want it,
say, 30px from the top of #top and 20px from the left border of #top. So
it seems I need to use absolute positioning, but only inside the #top
<div>. Hope it's possible...
Gustaf
1. A <div>, centered on screen, 600px wide and 100px high, with a
background-image (also 600 x 100).
2. Text (an <h1> element) positioned with precision inside the <div>, on
the image.
3. A similar result in IE and FF...
Here's some of the XHTML:
<body>
<div id="container" >
<div id="top">
<h1>Title</h1>
</div>
...
</div>
</body>
Here are selected parts of my CSS:
body {
text-align: center;
...
}
#container {
width: 600px;
...
margin-right: auto;
margin-left: auto;
...
padding: 0px;
}
#top {
width: 600px;
height: 100px;
background-image: url('banner.png ');
...
padding: 0px;
}
#top h1 {
...
}
I can't figure out how to position the text in '#top h1'. I want it,
say, 30px from the top of #top and 20px from the left border of #top. So
it seems I need to use absolute positioning, but only inside the #top
<div>. Hope it's possible...
Gustaf
Comment