user3075987
user3075987

Reputation: 881

How do I center the body text div?

I found out how to center the title of my page, but can't figure out how to center the div which holds the summary description text (wrapper-summary-description).

If you look at my jsfiddle (http://jsfiddle.net/huskydawgs/L19g6jk6/) you'll see the text that talks about the Subaru Forester is currently on the left. I would like that div to be centered.

How do I do it?

Here's my jsfiddle: http://jsfiddle.net/huskydawgs/L19g6jk6/

Here's my code:

    <div class="products-intro-1st rtecenter">
    <h2 class="section-title blue"> 
        <span class="section-title-bold">Subaru</span> Forester</h2>
</div>
<div class="wrapper-summary-description rtecenter">
<p class="summary-description">
    The Subaru Forester is a compact crossover manufactured since 1997 by Fuji Heavy Industries and sold under the Subaru brand. Available in Japan from 1997, the Forester shares its platform with the Impreza. It was introduced in 1997 as a compact crossover wagon. It has been crowned Motor Trend's 2014 SUV of the Year and The Car Connection's Best Car To Buy 2014
</p>
</div>

Here's my css:

.products-intro-1st {
margin: 50px 0 0 0;

}

h2.section-title {
    font-family: SegoeRegular, Helvetica, Arial;
    font-size:32px;
    font-weight: normal;
    margin: 10px 0 50px 0;
    border-bottom: 1px dotted #f66511;
    padding:0 0 5px 0;
}

h2.section-title-bold {
    font-weight: bold;
}

.wrapper-summary-description {
    position:relative;
    width:540px;
    border: none;
    margin: 40px 0 0 0;
    overflow: hidden;
}

.summary-description {
        color: #232323;
        font-family: Helvetica, Arial, sans-serif;
        font-size: 14px;
        line-height: 25px;
        margin: 0;
        text-align: left;
}

.rtecenter {
    text-align:center
}
.blue { color: #2251a4; }

Upvotes: 0

Views: 51

Answers (1)

Joseph
Joseph

Reputation: 1086

.wrapper-summary-description {
    margin: 0 auto;   
}

Upvotes: 3

Related Questions