简体   繁体   中英

Adding Width property moving content to the left

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM