HTML CSS Styles

Styles in HTML

The following example demonstrates how to format an HTML document with style information added to the section.

<html>
<head>
<style type="text/css">
h1 {
	color: red;
}
h3 {
	color: blue;
}
</style>
</head><body>
<h1>heading text in red</h1>
<h3>heading text in blue </h3>
</body>
</html>

Nonunderlined Link

<html>
<head>
</head>
<body>
<a href="http://www.loopandbreak.com" style="text-decoration:none;"> 
ayunor learning </a>
</body>
</html>

Link to an External Style Sheet

Good design conventions say that, it’s always good to seperate style with other code, So for linking additional style sheets into out html document we use external linked style sheets. The following example demonstrates the syntax and directory structure. please consider both style.css and .html file are in the same directory.
Code for style.css

h1
{
 color:red;
}

code for index.html file.

<html>
<head>
<title> external style sheets linking</title>
<link rel="stylesheet" type="text/css" href="style.css" >
</head>
<body>
<h1> external style sheets</h1>

</body>
</html>