Text in paragraph won't stay in the area I want

Text in paragraph won't stay in the area I want
0

#1

Hi,

I’m working on a a rough site to learn and set everything in a container with an 80% width.

I have a p element with a lot of writing and wanted to keep it within a small area so had the width at 150px, but it won’t move. It still follows the parent container and stretches out to the 80% mark. Anyone have any suggestions as to why this might happen?

any help would be greatly appreciated.


#2

Paragraphs are block level elements, so they will always want to take up the full width of the container they are in. To change the width, add the display property in your CSS code and make the value inline-block. Hope that works!