An HTML page with CSS rules and HTML attributes : html « Tags « HTML / CSS






An HTML page with CSS rules and HTML attributes

    
<!DOCTYPE html> 
<html> 
<head> 
<title></title> 
<style> 
h1 { 
text-align: center; 
color: darkblue; 
} 
.intro-text { font: 12pt sans-serif; } 
</style> 
</head> 
<body> 
<h1>Hello World Wide Web</h1> 
<p class="intro-text"> 
Welcome to this webpage,<br/> 
It's <em>so</em> nice to see you. 
</p> 
<hr/> <!-- horizontal rule --> 
</body> 
<!-- function to make the text red when clicked --> 
<script type="text/javascript"> 
document.body.onclick = function () { 
document.body.style.color = 'red'; 
} 
</script> 
</html>

   
    
    
    
  








Related examples in the same category

1.'html' identifies an HTML document
2.XHTML headers
3.Body tag
4.HTML document structure
5.Working with Structure
6.Structured XHTML 1.1 Document
7.Set margin and padding for both and body
8.Style for HTML
9.Using CSS with HTML
10.Template to illustrate all
11.'xmlns' declares a namespace for creating unique custom tags in the HTML document
12.'version' indicates the version of HTML