Another basic CSS question. What I would like to do is to create a part of page
that contains a photo with a caption that is centered on the page, something
like this:
-------------------------------------------
| some other part of the page |
-------------------------------------------
| |
| --------------------------- |
| | | |
| | | |
| | picture | |
| | | |
| --------------------------- |
| Caption line 1 |
| Caption line 2 |
| |
-------------------------------------------
| some other part of the page |
-------------------------------------------
After some experimenting and checking the web I've come up with the following
HTML
<div id="pagecontent">
<div id="picture">
<img src="port.jpg" alt="" width="480" height="640" /><br />
<p>Ett litet test</p>
</div>
</div>
and the CSS
#pagecontent
{
width: 480px;
margin: 0 auto;
}
#picture img
{
padding: 6px;
margin: 0px;
border: 1px solid #555;
}
#picture p
{
padding: 0px;
text-align: center;
}
while this works it requires that I adjust the width of pagecount. My problem is
that I want to generate these pages automatically, and while the program I use
generate height and width tags that I can use I can't do math. Which means that
if I want to have the border around the picture the centering will be slightly
off.
So I start to wonder if there is some better way of doing this that doesn't
require me to know the picture size.
jem
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/