+ 1
What's the problem with this...??
I wanna align the text HELLO in this code but it doesn't work https://code.sololearn.com/Wdf348G20g0e/?ref=app
2 Respuestas
+ 5
Reet
I do not believe CSS has a center attribute for text-align.
edit: my mistake.
I now believe it works only on block level tags, like div and p.
https://www.w3schools.com/cssref/tryit.asp?filename=trycss_text-align
+ 4
Hello Reet,
Welcome to Sololearn!
There are a couple problems with your code:
1. You left the hello out of the <i> tag. Put it in.
2. <i> is an inline element. Align only works on block type elements. Remove the styling from the <i> tag (an inline element) and put it in the <h1> tag (a block type element) instead.
3. Correctly close off your <head> tag with </head>
4. Get the needed habit of putting code to display (here you want to display hello) in the proper tag, which is <body>.
5. For better readability of the code, practice indenting it so it's easier to read.
Hope this helps.
See code below for the aligned hello.
https://code.sololearn.com/WSuDPDdvaPtp/?ref=app