amosharper
11-06-2007, 04:29 AM
Hi all,
I'm facing a problem with positioning several small images at any given position on a larger background image. Since my page is centered, I need to position these relative to the top-center of the page, so they stay in exactly the same place above the background image, which is an 800x600px untiled jpeg (bodypic.jpg).
The overlay images in the code below are [rv_splat.jpg]. I currently have only put one in, as you can see.
[index.htm]body {
background-color: #FFFFFF;
font-size:12px;
font-family:Verdana;
margin: 0;
padding: 0;
}
div#splat_rv {
position: relative;
right: 250px;
z-index: 1;
}
div#bodypic {
top: 0;
text-align: center;
background: url(bodypic.jpg) no-repeat top center;
background-attachment: scroll;
height: 600px;
margin-left: auto;
margin-right: auto;
margin-top: 0px;
padding: 0px;
border: /*thin solid #FFFFFF*/none;
z-index: 0;
}
div#bodypic_bshadow {
text-align: center;
background: url(bodypic_bshadow.jpg);
background-attachment: scroll;
background-position: 50% 0%;
background-repeat: no-repeat;
height: 27px;
margin-left: auto;
margin-right: auto;
margin-top: 0px;
padding: 0px;
z-index: 0;
}
[style1.css]
<head>
<title>School of Motoring</title>
<LINK rel="stylesheet" type="text/css" name="style1" href="style1.css">
</head>
<body>
<div id="bodypic">
<div id="splat_rv"><img src="splat_rv1.gif" border=0></img></div>
</div>
<div id="bodypic_bshadow"></div>
</body>
The problem is that making the rv_splat overlaying images relative to the page means that I can only have one image per line, rather than at an arbitrary y position. This is no good - I need the images to be at any given position relative to y=0% and x=50%.
Is there a wrokaround, or way of doing this?
Note: The images will later be linked to new pages, so the solution will have to be able to wrap <a> tags around.
Huge thanks in advance,
- Amos
I'm facing a problem with positioning several small images at any given position on a larger background image. Since my page is centered, I need to position these relative to the top-center of the page, so they stay in exactly the same place above the background image, which is an 800x600px untiled jpeg (bodypic.jpg).
The overlay images in the code below are [rv_splat.jpg]. I currently have only put one in, as you can see.
[index.htm]body {
background-color: #FFFFFF;
font-size:12px;
font-family:Verdana;
margin: 0;
padding: 0;
}
div#splat_rv {
position: relative;
right: 250px;
z-index: 1;
}
div#bodypic {
top: 0;
text-align: center;
background: url(bodypic.jpg) no-repeat top center;
background-attachment: scroll;
height: 600px;
margin-left: auto;
margin-right: auto;
margin-top: 0px;
padding: 0px;
border: /*thin solid #FFFFFF*/none;
z-index: 0;
}
div#bodypic_bshadow {
text-align: center;
background: url(bodypic_bshadow.jpg);
background-attachment: scroll;
background-position: 50% 0%;
background-repeat: no-repeat;
height: 27px;
margin-left: auto;
margin-right: auto;
margin-top: 0px;
padding: 0px;
z-index: 0;
}
[style1.css]
<head>
<title>School of Motoring</title>
<LINK rel="stylesheet" type="text/css" name="style1" href="style1.css">
</head>
<body>
<div id="bodypic">
<div id="splat_rv"><img src="splat_rv1.gif" border=0></img></div>
</div>
<div id="bodypic_bshadow"></div>
</body>
The problem is that making the rv_splat overlaying images relative to the page means that I can only have one image per line, rather than at an arbitrary y position. This is no good - I need the images to be at any given position relative to y=0% and x=50%.
Is there a wrokaround, or way of doing this?
Note: The images will later be linked to new pages, so the solution will have to be able to wrap <a> tags around.
Huge thanks in advance,
- Amos