unit-iv HTML
unit-iv HTML
CSS saves time: You can write CSS once and reuse the same sheet in multiple HTML pages.
Easy Maintenance: To make a global change simply change the style, and all elements in all the
WebPages will be updated automatically.
Search Engines: CSS is considered a clean coding technique, which means search engines won’t have
to struggle to “read” its content.
Superior styles to HTML: CSS has a much wider array of attributes than HTML, so you can give a far
better look to your HTML page in comparison to HTML attributes.
Offline Browsing: CSS can store web applications locally with the help of an offline cache. Using this
we can view offline websites.
CSS Example
<html>
<head>
<style>
h1
{
color:white;
background-color:red;
padding:5px;
}
Department of Computer Engineering Page 1
Subject Name: Static Webpage Design Unit No: IV Subject Code: 4311603
P
{
color:blue;
}
</style>
</head>
<body>
<h1>Write Your First CSS Example</h1>
<p>This is Paragraph.</p>
</body>
</html>
CSS is added to HTML pages to format the document according to information in the style sheet.
There are three ways to insert CSS in HTML documents.
1. Inline CSS
2. Internal CSS
3. External CSS
Inline CSS
Internal CSS
color:blue
}
</style>
External CSS
For example: P
{
color:blue
}
You need to link this style.css file to your html pages like this:
<link rel="stylesheet" type="text/css" href="style.css">