Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alignment problem 1

Status
Not open for further replies.

audiopro

Programmer
Apr 1, 2004
3,165
GB
I am trying to align 2 pictures so that as a pair they are centered in a column (leftcol).
In FF the images are centered ok.
In IE6 they are off centre.
I can pad them to look correct in IE6 but then they are off centre in FF.

I have made the container background red, this shows in IE6 but not in FF.
I think my day can only get better.

Code:
CSS
.leftcol{
	width:330px;
	float:left;
	text-align: center;
	margin-left:auto;
	margin-right:auto;
}

.padcon{
	width:300px;
	text-align: center;
	margin-left:auto;
	margin-right:auto;
	background-color:#f00;
}

.padv{
	width:140px;
	float:left;
	padding:5px;
}
Code:
HTML

<div class='padcon'>
<div class='padv'>
IMAGE
<!-- ENDIV padv --></div>
<div class='padv'>
IMAGE
<!-- ENDIV padv --></div>
<!-- ENDIV padcon --></div>

Keith
 
How about:
Code:
<div style="text-align: center;">
  <img src="myImage1.jpg" alt="left side of pic" /><img src="myImage2.jpg" alt="right side of pic" />
</div>

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Thanks for the pointer
I think I was suffering from over complication.
I was trying to cure the problem by adding more divs when the solution was to assign a class to the image itself and let them fall into place naturally. Alignment perfect now so on with the show.

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top