+ 1
What is my error ?
<html> <head> <h1 {color:orange;}> a sample heading<\h1> </head> </body> <\html>
5 Answers
+ 10
If you want to do inline styling (within tags), you have to use style="YOUR_STYLE" format but not {YOUR_STYLE} format.
+ 9
Few corrections needed
<html>
<head>
<title>In-line CSS</title>
</head>
<body>
<h1 style="color:orange;"> a sample heading</h1>
</body>
</html>
Compare above code with your, you would find following errors.
1. <head> tag is used for representing document properties such as title, meta and
external links. You have mistakenly placed <h1> in <head> section that is not allowed.
and will not be rendered properly
2. Start <body> tag is missing.
3. For applying in-line css style attribute has to be defined for respective tag, wherein
each property:value set has to be separated by a semi-colon.
<tag style = "prop:value;">...</tag>
4. In closing tag you have used forward slash (\) instead of backward slash (/).
Nevertheless, keep practicing, all the best.
+ 4
Try this code.
<html>
<head>
</head>
<body>
<h1 style="color:orange;"> a sample heading<\h1>
</body>
<\html>
+ 3
It's not done the way you are doing.
<html>
<head>
<h1 style="color:orange"> a sample heading<\h1>
</head>
</body>
<\html>
Use style attribute for inline style.
Use external CSS file or style tag for using selectors.
I recommend u going through the CSS tutorials in Sololearn or w3schools to know more.
+ 2
thanks