Hello fellow Campers; I have a small problem here: The display property(:flex) will not apply to the html elements. Attributes like color: and background: works fine. I used *{ margin:0auto;} instead to center the elements; but would like to know what am I doing wrong here
display: flex makes the direct children of your container flex items. In your case your telling your <div>'s which are children of your <body> to be flex items and not elements inside them. So that’s basically the 2 <div>'s that you used to be containers of the texts. if you make each or either of those <div>'s display: flex then centering them will work. Hope this helps.
It does apply. I just tested it. What were you hoping it would look like? if you want to see them stacked next to each other change flex-direction to row;
although he could use align-items: center;, it won’t solve his problem 100%, or get the look he wants.
EDIT: and using text-align: center will actually solve his problem too. But I think he’s trying to learn display: flex so my first answer would be the direct answer to his problem.