Click here to Skip to main content
15,881,044 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
A very basic but big proplem , my html file is not showing css effects.
I have created project on desktop
The folder includes three files
1) images
2) index.html
3) css
css folder includes styles file

What I have tried:

<pre><!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="stylesheet" href="css/styles.css" />
	
    <title>Xyz/title>

</head>
<body>
<div class="container">
      <div class="navbar">
           <nav>
			     <ul>
				     <li><a href="">Home</a></li>
	                 <li><a href="">Products</a></li>
				     <li><a href="">contact us</a></li>
				  

					 
				 </ul>
	        </nav>
	</div>
</div>
</body>
</html>




styles.css file
.h1{
	text-align: center;
}

nav{
	flex:1;
	text-align:right;
}
nav ul li{
	list-style: none;
	display: inline-block;
	margin-right: 30px;
}
Posted
Updated 15-Sep-22 9:23am
Comments
Richard MacCutchan 15-Sep-22 12:21pm    
I just tried that with inline CSS and it works. Check that your CSS file is getting loaded.

1 solution

You have:

HTML
<link rel="stylesheet" href="css/styles.css" />


Please try:
HTML
<link rel="stylesheet" href="./css/styles.css" />
 
Share this answer
 

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



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