Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

How can I change the width of a paragraph in bootstrap columns (col-lg-6)?

I am using bootstrap to create columns, but I want to shorten the width of the paragraph in it. If I change the width of the <p>, it floats left, but float: none and text-align: center doesn't work. Any ideas?

Why don't you try to give the paragraph a class, then add padding on that class. i would imagine something like this

//the html

<div class="col-lg-6">
  <p class="some__class"> text goes here </p>
</div>

// the css
.some__class{
  text-align: center;
}

//or

<div class="col-lg-6 some__class">
    <p> text goes here </p>
</div>

1 Answer

Hey, thank you, that worked :)