To do that, wrap both elements with a span element. Let’s do this first before centering them. However, what we want is to keep them one below the other, probably the title at the top and the paragraph at the bottom. To do that, we need to add these three Flexbox CSS rules to the inner div:Īs you can see, I use nested □ Flexbox which is more common when using Flexbox.īoth the heading and paragraph are trying to be in the middle of the div horizontally and vertically. Now, let’s center the content horizontally and vertically using Flexbox. The layout will look like this right away! The ultra-soft 300 GSM hypoallergenic microfiber filling will keep you warm □ for a better sleep during □ cold nights. Now, let’s add some content on the left column and an image on the right. I’ve also added the border to them just for viewing purposes. To do that, add flex:1 css rule to the inner divs. Now, let’s spread these two divs evenly to fill its parent width horizontally. It lays its children beside each other, which is exactly what we want to make the two columns.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |