How to center an image in php and css?

MudiW

New member
I'm trying to make a header. Left image, middle image and right image. But I can't find the way

Code:
.topbandl { background-image: url(images/l_header.png); float: left; font-size: 10px; height:105px; position: relative; width: 20px;}
.topbandm { background-image: url(images/header_bg.png); margin:auto; font-size: 10px; height:105px; position: relative; width: 879px; }
.topbandr { background-image: url(images/r_header.png); float: left; font-size: 10px; height:105px; position: relative; width: 19px; }

In the php

Code:
<div class="topbandl">
<div class="topbandm">
<div class="topbandr"></div>
THANKS
 
That is not necessarily PHP, its just HTML with the code that you provided. Anyways, float it mainly used for aligning if there is are tables.
To be safe I would use all the alignment properties, margin, text-align, float and align.
.topbandl { background-image: url(images/l_header.png); float: left; margin-left:left; align:left; text-align: left; font-size: 10px; height:105px; position: relative; width: 20px;}
.topbandm { background-image: url(images/header_bg.png); margin:auto; font-size: 10px; height:105px; position: relative; width: 879px; float: middle; margin-left:auto; margin-right:auto; align:center; text-align: center; }
.topbandr { background-image: url(images/r_header.png); float: right; margin-left:right; align:right; text-align: right; font-size: 10px; height:105px; position: relative; width: 19px; }

Secondly, I noticed in "topbandr" your float is still aligned float "left".

Good Luck!
If you need further assistance/advice, feel free to contact me.
 
Back
Top