Computer ForumsComputers  

Go Back   Computer Forums > Programmers Lounge > Programming Discussions

Reply
 
LinkBack Thread Tools Display Modes
Old 01-01-2005, 07:21 AM   #1 (permalink)
Junior Techie
 
Join Date: Mar 2004
Posts: 56
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   Reply With Quote
Reply

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



All times are GMT -5. The time now is 10:38 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0