Page 195 - Webapplication11_C11_Flipbook
P. 195
Example:
Style1.css has the following rules:
body
{ background-color: pink;}
h1
{ color: maroon; font-size: 20px;
font-family: courier; font-style: italic;}
We apply this in an html file as follows:
<!DOCTYPE html>
<html>
<head>
<style>
body
{ background-color: pink;}
h1
{ color: maroon; font-size: 20px;
font-family: courier; font-style: italic;}
</style>
</head>
<body>
<h1>Welcome to the Writer's Club!</h1>
<p>Almost all of your writing should be grouped into paragraphs
if it is longer than a few sentences.</p>
</body>
</html>
This will give an output as follows:
Internal Style Sheet
If a single HTML page has a distinct style, an internal style sheet may be used. The internal style is defined within the
head section’s <style> element. Internal style sheet rules take precedence over rules defined in an external CSS file.
Example:
<!DOCTYPE html>
<html>
<head>
Website Building Using HTML and CSS 193

