Help needed in closer look at css lesson


#1


<!DOCTYPE html>
<html>
<head>
	<title>Sprout</title>
	<link rel="stylesheet" type="text/css" href="main.css"/>
</head>
<body>
body {
	height: 100%;
	margin: 0;
	text-align: center;
	width: 100%;
}
	<h1>Mystwood Publishers Ltd.</h1>
	h1 {
	font-size: 32px;
  font-family: Palatino, 'Palatino Linotype', serif;
  color:	rgb(216,218,190);
}
	<div class="hero">
	.hero {
	padding: 250px 0;
	margin: 30px;
  font-family:'Trebuchet MS',Helvetica,sans-serif;
  background-image: url(http://ichef-1.bbci.co.uk/news/976/cpsprodpb/1572B/production/_88615878_976x1024n0037151.jpg); 
    background-size: cover;
  color:#ffffff;
}
.hero a {
	color: #00FFAA;
	font-size: 1.25rem;
	text-decoration: none;
}
		<h2>Sprout.</h2>
		h2 {
	font-size: 56px;
}
		<p>A book by J. Daniel Bedford</p>
		p {
  font-size: 2rem;

}
		<a href="#">Read now.</a>
	</div>
	<p id="footer">&copy; Mystwood Publishers Limited</p>
	#footer{
  font-size:0.75rem;
}
</body>
</html>
 
i have written code like this but when i open in browser seperatly i coudn't get the proper formation and got like this 
body { height: 100%; margin: 0; text-align: center; width: 100%; }
Mystwood Publishers Ltd.
h1 { font-size: 32px; font-family: Palatino, 'Palatino Linotype', serif; color: rgb(216,218,190); }
.hero { padding: 250px 0; margin: 30px; font-family:'Trebuchet MS',Helvetica,sans-serif; background-image: url(http://ichef-1.bbci.co.uk/news/976/cpsprodpb/1572B/production/_88615878_976x1024n0037151.jpg); background-size: cover; color:#ffffff; } .hero a { color: #00FFAA; font-size: 1.25rem; text-decoration: none; }
Sprout.
h2 { font-size: 56px; }

A book by J. Daniel Bedford
p { font-size: 2rem; } Read now.

© Mystwood Publishers Limited
#footer{ font-size:0.75rem; } 
where i'm wrong .please correct me .


#2

This is CSS and it needs to be under the tab main.css

This bit also under CSS tab


#3

thanks for the reply sir ,but i have a doubt if i write the code in Notepad++ how to mix Html and css code ...


#4

Read this article: Typing code on your computer


#5

This topic was automatically closed after 7 days. New replies are no longer allowed.