Hi there, from googling round this seems like an age old problem best solved by using tables, but in fear of missing something obvious I felt I should post here!
I'm trying to align a div in the exact centre of another div, both vertically and horizontally, I've achieved this horizontally but can't seem to get it to work vertically.
The CSS of the parent div is:
While the CSS of the inner div is:
The live site is www.cypherhosting.co.uk , the relevant element is the not-so-centrally-aligned content box inside the bigger content box under the menu buttons.
Thanks guys!
I'm trying to align a div in the exact centre of another div, both vertically and horizontally, I've achieved this horizontally but can't seem to get it to work vertically.
The CSS of the parent div is:
Code:
.contentbox
{
background-image:url('/images/ContentBoxV1.jpg');
height:200px;
width:1024px;
}
While the CSS of the inner div is:
Code:
.innercontentbox
{
background-image:url('/images/InnerContentBoxV2.jpg');
height:170px;
width:300px;
margin-left:auto;
margin-right:auto;
}
The live site is www.cypherhosting.co.uk , the relevant element is the not-so-centrally-aligned content box inside the bigger content box under the menu buttons.
Thanks guys!
Last edited: