middle

CSS Centering vs text-align

0:00
↔️ ↕️

Timecodes:

okay next I want to talk about the

concept of centering with CSS versus the

actual text align property now text a

line what it does is it says all of the

text elements here so this is a text

node inside of a paragraph element this

is a text node inside of a paragraph

element this is a text node inside of an

h1 element the h1s inside of the header

we can see here the paragraphs inside of

main so text align says take all this

text and align it left or right or

justify it or Center it within its

parent element so if I come up here and

I say for my paragraphs all my

paragraphs what I want to do is I'm

going to apply text align and I can say

Center save that there we go all of the

text inside of here is centered now we

can remove this go back to the left we

could make this right we can make it


Related queries:


how to vertical align text in div css
how to center left align text in css
how to center justify text in css
how to center align content in css
how to center text in css flex
how to center text in css grid
how to center text in css bootstrap
how to align text bottom center in css
how to set text vertical alignment in css