Adding css in html

I have linked the CSS file in my html code, but it is not making any changes in the website. Please help me.

@pujitharoopa it may be a path issue. Can you please share your folder structure and code?

<!DOCTYPE html>  
<html>
   <head>
   	<title>Learning html</title>
   	<link rel="stlyesheet" type="text/css" href="coffeeshop.css">
   	
   </head>
   <body>
   	<div class ="available-coffee out-of-stack" id="mocha">
   		<h4>Mocha</h4>
         <img src="mocha.webp" class="div-img">
   	</div>
   	<div class="available-coffee in-stack">
   		<h4>Cappuccino</h4>
         <img src="cappuccino.webp" class="div-img">
   	</div>
   </body> 
</html>
.available-coffee{
	color:orange;
	height: 300px;
	width: 300px;
}
.out-of-stack{
	border: 2px dotted red;
}

.in-class{
	border: 4px double green;
}

.div-img{
	height: 80%;
	width: 100%;
}
#mocha{
	color:green;
}

@pujitharoopa is the html and css file in the same folder? If possible, please share a screenshot of these files open in a code editor.

check if both files are in same folder or the name you have linked in the href attribute has no spelling mistake .If the css file is in different folder then copy the relative path of it or root path (relative path recommended) and then paste it in href of your link tag.

1 Like