Log in

View Full Version : Absolute centered block



dobaym
08-19-2008, 10:14 PM
Hello all,

I am having a problem with an img that I want to center.Its a very simple photo album.My problem is, if the Img is not absolutely positioned, than FF doesnt display it with height:100%.
#background is the img.
#btnr right button.
#btnl left button.
This is the css:


html,body{margin:0;padding:0;width:100%;height:100%;overflow:hidden;background-color:#666633;}


#background{ display:block; margin-left: auto; margin-right: auto; z-index:1; width:auto; height:100%; border: 0; padding: 0; visibility: visible;}

#btnl{ position: absolute; z-index:2; width:4%; height:auto; border: 0; padding: 0; visibility: visible; margin:0 1%;left:0; top:50%;}

#btnr{ position: absolute; z-index:2; width:4%; height:auto; border: 0; padding: 0; visibility: visible; margin:0 1%; right:0; top:50%;}

--------------------------------------------------------------
Please help if you can!
Thanks for your time!
Martin

TheJoshMan
08-19-2008, 10:18 PM
Please post a link to the page on your site that contains the problematic script so we can check it out.

dobaym
08-19-2008, 10:23 PM
Thats not possible at the moment, because its only in the making, and hasnt been uploaded yet.
:(

dobaym
08-19-2008, 10:28 PM
Is there any info missing that would help you understand the problem better?

TheJoshMan
08-19-2008, 10:28 PM
well at the very least, we need to see more than just the CSS to determine what the problem is. We'll need to see how it's implemented (the HTML) as well.

dobaym
08-19-2008, 10:31 PM
Here you go:

<body>

<div>
<a href="O1.html"><img id="btnl" src="BTNL.gif" alt=""width="43" height="44" border="0" ></div>


<div>
<a href="O3.html"><img id="btnr" src="BTNR.gif" alt=""width="43" height="44" border="0" ></a></div>


<div>
<img id="background" src="O2b.jpg" alt=""width="867" height="650" border="0" align="center"></div>



</body>

dobaym
08-19-2008, 11:15 PM
Sorry but I have to go to bed, its 1:15 am in Hungary right now, and I am very tired.
So if you have any suggestion for the things above, than please post it and I will check up on it tomorrow!
Thank you very much for your help and patience!

Good evening

Martin