I am working on a page that has 3 columns of text. I am trying to center the text in each column while maintaining the left justification for the text.
When I try to use margin-left:auto; margin-right:auto;
the spacing for the columns is destroyed. I have also tried putting a div around the paragraphs and tried to center that, but either I am doing something wrong or it isn't affecting anything.
Here is a link to a page that shows the text and how they are not working. http://pages.suddenlink.net/salisburra/index2.html
Thanks so much for any help you can provide =)
This is the html from the page:
...
<body>
<div class="tripletBox linkBlock">
<p>
Suggested Itinerary<br />
Brochures
</p>
</div>
<div class="tripletBox linkBlock">
<p>
Lesson Plans<br />
Cool Sites
</p>
</div>
<div class="tripletBox linkBlock">
<p>
Featured Images<br />
Opportunities
</p>
</div>
</body>
Here is the css applying to the html:
body {
margin-left: auto;
margin-right: auto;
min-width:1020px;
max-width:1020px;
...
}
.tripletBox{
float:left;
width:26.36%;
margin-left:3.48%;
margin-right:3.48%;
}
.tripletBox > * {/*centers images in the tripletBox container*/
display:block;
margin-left:auto;
margin-right:auto;
}
.linkBlock {
...
text-align:left;
}