html - CSS Align Paragraphs Horizontally -


i have several paragraphs under class want align horizontally. basically, want each paragraph have own column.

i used float: right;. made them columns, brought them out of formatting rest of webpage.

any tips on different ways create columns, or format float appreciated.

you use css columns.

div {    -webkit-column-count:3; /* chrome, safari, opera */    -moz-column-count:3; /* firefox */    column-count:3;    -webkit-column-gap:40px; /* chrome, safari, opera */    -moz-column-gap:40px; /* firefox */    column-gap:40px; } 

from w3schools.

or list items if you're going have control on text.

html

<ul>     <li>paragraph</li>     <li>paragraph</li>     <li class="last">paragraph</li> </ul> 

css

ul {     width: 100%;     margin: 0;     padding: 0;     list-style: none; }  ul li {     float: left;     width: 30%     margin-right: 5%; }  ul li.right {     margin-right: 0; } 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -