Centering items using CSS

Centering items using CSS
0.0 0

#1

Would someone be able to explain to me what CSS I can use to center the social media links at the bottom of this page? (the ones that are outlines in green) I’ve been fiddling around with text-align, and margin:auto; and I can’t quite seem to figure it out.


#2

Centering elements on browser never gets old.

To horizontally center a Block element, use margin: 0 auto

To horizontally center a inline-block and inline element, use text-align: center on the parent of the element you would like to center.

For your case, you will use text-align: center on the <div>. This will apply centering to all inline-block and inline element inside <div>. Using Dev Tools, check <li> gets centered, not the <ul> as <ul> is a block element.


#3

Hey like @ivanyapeter said, you need to center via text-align: center and display: inline-block;

like this:

https://codepen.io/g-hammer/pen/xWjYOb?editors=1100

You also forgot some brackets and i changed the last paragraph to a list-item and wrapped
your lists in divs, so its easier to center the 2 rows separately.

greets f