+ 2

CSS doesnot work when I put it in head tag but works when I put in body tag.does anyone have same problem??

CSS working

3rd May 2017, 9:28 AM
Syed Muhammad Ali Naqi Rizvi
Syed Muhammad Ali Naqi Rizvi - avatar
17 Respostas
+ 1
do you put tag like this: <head> <style> </style> </head> ?
3rd May 2017, 9:35 AM
Nikola Stojiljkovic
Nikola Stojiljkovic - avatar
+ 5
as suspected, you got multiple typos: it should be forwarded slash and not back slash. the following should work (copy and paste if you want) <!doctype html> <html> <head> <style type="text/css"> p {color:green;} </style> </head> <body> <p>problem with css solved? </p> </body> </html>
3rd May 2017, 9:56 AM
Thanh Le
Thanh Le - avatar
+ 2
as suspected, you got multiple typos: it should be forwarded slash and not back slash.
3rd May 2017, 9:48 AM
Thanh Le
Thanh Le - avatar
+ 2
if my answer helped you, please consider marking it as the beste answer. I'd highly appreciate. :)
3rd May 2017, 10:09 AM
Thanh Le
Thanh Le - avatar
+ 1
check for typos of the <style>- and <head>-tags. it should work the way Nikola mentioned
3rd May 2017, 9:41 AM
Thanh Le
Thanh Le - avatar
+ 1
remove type in style tag, try that :)
3rd May 2017, 9:47 AM
Nikola Stojiljkovic
Nikola Stojiljkovic - avatar
+ 1
yeah for sure I am quite busy now when I will try I will let you know by marking your answer the best.
3rd May 2017, 10:13 AM
Syed Muhammad Ali Naqi Rizvi
Syed Muhammad Ali Naqi Rizvi - avatar
0
yes I put in the same way
3rd May 2017, 9:36 AM
Syed Muhammad Ali Naqi Rizvi
Syed Muhammad Ali Naqi Rizvi - avatar
0
Hmm can you share code? :)
3rd May 2017, 9:37 AM
Nikola Stojiljkovic
Nikola Stojiljkovic - avatar
0
yeah sure
3rd May 2017, 9:39 AM
Syed Muhammad Ali Naqi Rizvi
Syed Muhammad Ali Naqi Rizvi - avatar
0
<html> <head> <style type="text/css"> p {color:green;} <\style> <\head> <body> <p>I have problem with css<\p> <\body> <\html>
3rd May 2017, 9:45 AM
Syed Muhammad Ali Naqi Rizvi
Syed Muhammad Ali Naqi Rizvi - avatar
0
In the same way when I work with other attributes it doesnot work
3rd May 2017, 9:46 AM
Syed Muhammad Ali Naqi Rizvi
Syed Muhammad Ali Naqi Rizvi - avatar
0
does brower have any effect on coding??
3rd May 2017, 9:47 AM
Syed Muhammad Ali Naqi Rizvi
Syed Muhammad Ali Naqi Rizvi - avatar
0
ok
3rd May 2017, 9:48 AM
Syed Muhammad Ali Naqi Rizvi
Syed Muhammad Ali Naqi Rizvi - avatar
0
no I am writing from my mobile thats why there are typos but when I write code on my laptop I am very careful.
3rd May 2017, 9:50 AM
Syed Muhammad Ali Naqi Rizvi
Syed Muhammad Ali Naqi Rizvi - avatar
0
@Thanh bravo
3rd May 2017, 9:58 AM
Nikola Stojiljkovic
Nikola Stojiljkovic - avatar
0
ok thanks tanh le and nikola stojiljkovic
3rd May 2017, 9:58 AM
Syed Muhammad Ali Naqi Rizvi
Syed Muhammad Ali Naqi Rizvi - avatar