Forum Moderators: not2easy
I've successfully centered a jpg horizontally on my page, using <div style="text-align:center;">.
Now I want to align a css box, its left margin starting at the left margin of the above centered jpg.
I've searched the web extensively and cannot find a solution unless I use absolute positioning which I don't really want to.
Thanks!
Came across a simple solution which I tried but didn't work. This can be seen at [communitymx.com ], if the article still sits at this location.
And then it struck me: somewhere I read that in nested DIVs one of the DIV's must have a width specified in pixels for them to align properly... and voila!
Here's my code:
<!-- saved from url=(0014)about:internet -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
img {display: block;}
div.wrapper {text-align:left; margin-left: auto; margin-right:auto; width:760px;}
body {text-align:center;}
-->
</style>
</head>
<body>
<div class="wrapper">
<img src="images/images/Website-beta_01.jpg">
<img src="images/images/orange-bar.png">
<img src="images/images/greenboxtop.png">
</div>
</body>
</html>
:)