Home > other >  Adding Width property moving content to the left
Adding Width property moving content to the left

Time:01-18

I have already provided margin for the main body. main{margin-left:200px; margin-right: 200px; text-align: center}

As I wanted to show the texts in two lines instead of one line, I added width property in style.

.p{font-size: 12px; width: 200px}

This line of could serves the purpose of showing the paragraph in two lines but it moves the text to the left.

Then even if I try

.p{font-size: 12px; width: 200px; text-align: center; align-items: center};

The paragraph won't budge. It stays in left, out of alignment.

How Can I solve this problem.

CodePudding user response:

I don‘t really understand what you want to archive. You could use a framework for example bootstrap, it‘s easy to learn and understand and also responsive.

CodePudding user response:

Essayez la propriété "white-space" avec la valeur "nowrap".

 p {

white-space: nowrap; }

  • Related