+ 4

My HTML and CSS code is wrong or not if right so why it's not wroking in sololearn?

<div>Hello Community</div> <style> div { background-color: hsl(180, 50%, 50%);   color: hsl(120, 0%, 100%); } </style>

28th Nov 2020, 1:18 PM
Vinay Jaiswal
Vinay Jaiswal - avatar
14 Answers
+ 6
Vinay Jaiswal u don't need style tags in css part can u give me the link of ur code or can u tell me where u put the whole code in html part or css part??
28th Nov 2020, 1:31 PM
Atul
Atul - avatar
+ 2
Vinay Jaiswal You have written style for div tag but the text you have written is inside p tag. Either write for p or div. P.S In the code link you have given.
30th Nov 2020, 10:38 AM
Krish
Krish - avatar
+ 1
The stye tag is in css but it is not working.
28th Nov 2020, 1:25 PM
Vinay Jaiswal
Vinay Jaiswal - avatar
28th Nov 2020, 1:32 PM
Vinay Jaiswal
Vinay Jaiswal - avatar
+ 1
Ok thanks atul
28th Nov 2020, 1:51 PM
Vinay Jaiswal
Vinay Jaiswal - avatar
+ 1
Your code is correct however there are some invisible characters preventing the code from working. Clearing your CSS and retyping it will fix the issue.
30th Nov 2020, 7:03 AM
Chris Coder
Chris Coder - avatar
+ 1
In sololearn There is CSS block which is linked to your html content So no need to write style tag in CSS
30th Nov 2020, 11:18 AM
The INDIAN
The INDIAN - avatar
+ 1
Epikx Dhi hsl stands for hue, Saturation and lightness It is used to define color
13th Dec 2020, 4:00 AM
Krish
Krish - avatar
0
the code should work as i expected. oh, btw, you can only put style in head tag..
28th Nov 2020, 1:21 PM
Rellot's screwdriver
Rellot's screwdriver - avatar
28th Nov 2020, 1:30 PM
Vinay Jaiswal
Vinay Jaiswal - avatar
0
Vinay, you should follow the rules of writing HTML code with CSS View this code to see a good rules on writing HTML code https://code.sololearn.com/WaZlRMTXHl6g/?ref=app
28th Nov 2020, 7:45 PM
Rufai Limantawa
0
What is hsl() guys?
13th Dec 2020, 3:46 AM
Epikx Dhi
Epikx Dhi - avatar