Boot left alignment text inside a centered div

I have a paragraph of four lines that represent poetry in a centered div. Since this is poetry, I need 4 lines aligned to the left, but not to the left of the div.

Here's how it is centered:

Lorem ipsum dolor sit amet, onsectetur adipisicin. Doloribus, totam unde facilis omnis temporibus nostrum in 

Here is how I want it:

  Lorem ipsum dolor sit amet, onsectetur adipisicin. Doloribus, totam unde facilis omnis temporibus nostrum in 

Thanks.

JSFIDDLE

+4
source share
5 answers

Here is the solution http://jsfiddle.net/YW7eS/2/

I removed text-align: center and used a grid system to give you more control.

 <div class="col-lg-offset-4 col-lg-4 col-md-offset-4 col-md-4 col-sm-offset-4 col-sm-4"> ... </div> 
+4
source

You might want to show us the code, but you probably want to do text-align:left in the paragraphs.

0
source

Since you do not provide any code, it is very difficult for you to help, but that (I think) is what you want. Change the left padding to any number to increase / decrease the text distance to the div.

 .poetry { padding: 0 0 0 20px; } .poetry p { text-align: left; } 
0
source

just try something like this:

 <div style="width: 500px; height: 500px; float: left;"></div> <div style="float: left; margin-left: 30px;"> Lorem ipsum dolor sit amet, onsectetur adipisicin. Doloribus, totam unde facilis omnis temporibus nostrum in </div> 
0
source

You can change the code as follows:

 .marketing .col-md-4 { text-align: left; margin-bottom: 20px; } 

see working fiddle here

0
source

Source: https://habr.com/ru/post/1501904/


All Articles