Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » how to centre an image within a div layer? please help
Closed Thread
Old 01-01-2005, 08:21 AM   #1 (permalink)
 
Junior Techie

Join Date: Mar 2004

Posts: 56

hooloovoo

Default how to centre an image within a div layer? please help

Hi all,

I am building a website for a uni project. It uses CSS for layout.

There are three columns defined in the css, a left menu, centre content layer, and a right menu layer. I want to put an image in the centre or the centre content layer. When i try to centre it though, it keeps centering in relation to the whole page rather than being centred in the layer itself.

How can I get the image to centre in the centre layer.

Here is the CSS code for the centre layer:



#centreContent {

<?php
if($_SESSION['centreColour'] == "")
{
//set default colour as maroon
echo 'background: #000066;';
}
else
{
//a colour exists in a session, use that colour instead
echo 'background: '.$_SESSION['centreColour'];
}
?>

position:absolute;
width:690px;
height:625px;
z-index:1;
left: 185px;
top: 2px;
color: #999999;
padding-left: 10px;
padding-right: 10px;
}



Here is the code for the image:




<div id="centreContent">













<div align="center">[img]images/welcomeTo_Heading_GIF.gif[/img]</div>
</div>



Thanks all

hooloovoo
hooloovoo is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On