Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends,

I have a simple html page and a CSS file. I dont know why html page is not recognizing the CSS. No css class is working on this html page in any browser.

Below is the code for html and css. Please let me know what I did wrong.

style.css

CSS
.bold
{
font-size:20px;
color:red;
}


index.html
XML
<html>
<head>
<link type="text/css" relation="stylesheet" href="style.css"/>
</head>
<body>
<b class="bold">hello world</b>
</body>
</html>




Thanks,
Jagjot
Posted
Updated 29-May-20 7:22am

It must be:

HTML
<link type="text/css" rel="StyleSheet" href="style.css" />


Also, check up if "style.css" is in right place.

—SA
 
Share this answer
 
You can add css in to the html page by putting inside the head tag and then putting inside tags that looks like this:
<style></style>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900