Why this code does not work properly? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 20

Why this code does not work properly?

https://code.sololearn.com/WQ0uEm7hTf7g/?ref=app

22nd Jun 2018, 9:20 AM
Vučko/Вучко/Vuchko
Vučko/Вучко/Vuchko - avatar
17 Answers
+ 9
If you did want to put styling on the html side then make sure you wrap it in its correct style tags. <style type="text/css"> ... </style>
22nd Jun 2018, 9:33 AM
ihateonions
+ 7
you need to put the following code in <style> element, like this: <style> p { color:white; background-color:gray; } </style>
22nd Jun 2018, 9:29 AM
Lucky Luke
+ 6
Remove the styling from the Html section and then remove the html from the css section and it works fine, HTML <head> <link rel="stylesheet" href="example.css"> </head> <body> <p>This is my first paragraph.</p> <p>This is my second paragraph. </p> <p>This is my third paragraph. </p> </body> CSS p { color:white; background-color:gray; }
22nd Jun 2018, 9:32 AM
ihateonions
+ 5
In HTML : <head> <link rel="stylesheet" href="example.css"> </head> <body> <p>This is my first paragraph.</p> <p>This is my second paragraph. </p> <p>This is my third paragraph. </p> </body> -------------------------------------------------- In CSS : p { color:white; background-color:gray; } --------------------------------------------------- Correct your code. it will work perfectly.
22nd Jun 2018, 3:21 PM
Rahul Sahani
Rahul Sahani - avatar
+ 5
put d p styling code in style tag.
23rd Jun 2018, 3:27 AM
Sia
Sia - avatar
1st Jul 2018, 11:13 AM
Yogesh Sambharam
Yogesh Sambharam - avatar
1st Jul 2018, 11:18 AM
Yogesh Sambharam
Yogesh Sambharam - avatar
+ 2
ok
1st Jul 2018, 11:14 AM
Yogesh Sambharam
Yogesh Sambharam - avatar
+ 1
Clear all the code in css section and the paste the following in it and also removing the same from html section: p { color: white; background-color: gray; }
23rd Jun 2018, 5:02 PM
Omkar Dedge
Omkar Dedge - avatar
+ 1
you are using html use css
28th Jun 2018, 3:35 PM
Yogesh Sambharam
Yogesh Sambharam - avatar
0
You need to put the code in style tags for the style features with the p.
23rd Jun 2018, 2:32 AM
Fellow Coder
0
If you did want to put styling on the html side then make sure you wrap it in its correct style tags. <style type="text/css"> ... </style>
23rd Jun 2018, 7:54 AM
Alex
Alex - avatar
0
Why r u using html tags in css
23rd Jun 2018, 8:52 AM
Prabodh Panda
Prabodh Panda - avatar
0
First of all:you need to remove any CSS tags or code you have written in the HTML file or section, Secondly:remove all the HTML tags from the CSS section. After all these steps the code will work fine 🙂
23rd Jun 2018, 8:20 PM
Shreya Karmakar
Shreya Karmakar - avatar
0
ok
24th Jun 2018, 9:02 PM
Kenneth Dennis Ifeanyichukwu
Kenneth Dennis Ifeanyichukwu - avatar
0
p { color:white; background-color:gray; } put this in external css file example.css or in <style> tag <style> p { color:white; background-color:gray; } </style>
25th Jun 2018, 8:16 AM
baa1425
0
are you slove this problem?
1st Jul 2018, 4:52 AM
baa1425