Centred items | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Centred items

How to center the elements inside the div? https://code.sololearn.com/W16kWL8Mlsvd/?ref=app

15th Feb 2020, 3:46 AM
Apologetica911
Apologetica911 - avatar
8 Answers
+ 3
good use of flex, just wrong property name, should be align-items three more comments i have made, all numbered: https://code.sololearn.com/WC106vmpxjc5/?ref=app CSS Pro Tips: Centering Elements by Domino https://www.sololearn.com/post/37760/?ref=app
15th Feb 2020, 3:56 AM
Gordon
Gordon - avatar
+ 1
The names of the properties in CSS are quite complicated. So in the parent element (div): - for horizontal: justify-content:center - and for vertical: align-items:center Thank you verry much!
15th Feb 2020, 4:28 AM
Apologetica911
Apologetica911 - avatar
0
Use the <center></center> tag
15th Feb 2020, 3:49 AM
boolean
boolean - avatar
0
In CSS. Vertical and horizontal
15th Feb 2020, 3:52 AM
Apologetica911
Apologetica911 - avatar
15th Feb 2020, 4:58 AM
Apologetica911
Apologetica911 - avatar
0
have you not read the other three comments i left for you in my fix?
15th Feb 2020, 5:08 AM
Gordon
Gordon - avatar
0
I came back with a new correction. Now it's good? https://code.sololearn.com/WQakF8Q859Qg/?ref=app
15th Feb 2020, 5:36 AM
Apologetica911
Apologetica911 - avatar
0
Yes it is good. And sorry I should mentioned that the first two comments were in the HTML tab. 1. No ; in html tag (Referring to your parent div, you have an extra semi-colon after class attribute) 2. Indent your code properly. So that you can read the hierarchy, and debug easily when the code grows. It is usually automatic if you are using a code editor.
15th Feb 2020, 6:16 AM
Gordon
Gordon - avatar