text-align:center not working in header and footer | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

text-align:center not working in header and footer

can any one tell me why is it not working. i have attached my code below https://code.sololearn.com/W1qZV1I6hE2I/?ref=app

15th Jul 2021, 5:29 PM
syscall
syscall  - avatar
9 Answers
+ 3
You many times duplicated css code. Why you use comma separated common styling, if you just after that use another style for the same element? CSS cascade-style-sheets. Which mean the last style cover previous style. Mingbai? in first: text-align: center /* correct */ in second: text-align: centre /* wrong */
15th Jul 2021, 5:43 PM
Shadoff
Shadoff - avatar
+ 4
There is a comma after section in "header,footer,section,"
15th Jul 2021, 5:31 PM
Abhay
Abhay - avatar
+ 2
it's spelled "center" and not "centre"
15th Jul 2021, 5:31 PM
Rohit
+ 1
Rohit got it dude thnx
15th Jul 2021, 5:46 PM
syscall
syscall  - avatar
+ 1
Here is my dummy landing page. You can look at css to see what happen. https://code.sololearn.com/WkUOocFatNx3/?ref=app
15th Jul 2021, 5:48 PM
Shadoff
Shadoff - avatar
+ 1
Shadoff are you mean selecting an element multiple times (for different purposes) is wrong?!! sometimes we can select an element multiple times. because it and other elements have shared properties.
16th Jul 2021, 1:30 PM
Mehran
Mehran - avatar
0
I wrote center in the code tho
15th Jul 2021, 5:42 PM
syscall
syscall  - avatar
0
Jagroop Singh Check your CSS line 10 and line 18 it's spelled "centre" and not "center".
15th Jul 2021, 5:45 PM
Rohit
0
try & select h1 { text-align :center; } not this header{ text-align :center; }
17th Jul 2021, 9:39 AM
blocked