0% found this document useful (0 votes)
7 views

unit-iv HTML

Uploaded by

Kassahun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

unit-iv HTML

Uploaded by

Kassahun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Subject Name: Static Webpage Design Unit No: IV Subject Code: 4311603

Unit IV: Cascading Style Sheets (CSS)


 Cascading Style Sheets (CSS)

CSS provides basic and advanced concepts of CSS technology.


The major points of CSS are given below:
o CSS stands for Cascading Style Sheet.
o CSS is used to design HTML tags.
o CSS is a widely used language on the web.
o HTML, CSS and JavaScript are used for web designing. It helps the web designers to apply style on
HTML tags.

 Why to Learn CSS?

 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>

 How to add CSS

 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

 Inline CSS is used to apply CSS on a single line or element.


For example:
<p style="color:blue">Hello CSS</p>

 Internal CSS

 Internal CSS is used to apply CSS on a single document or page.


 It can affect all the elements of the page.
 It is written inside the style tag within head section of html.
For example:
<style>
P
{
Department of Computer Engineering Page 2
Subject Name: Static Webpage Design Unit No: IV Subject Code: 4311603

color:blue
}
</style>

 External CSS

 External CSS is used to apply CSS on multiple pages or all pages.


 Here, we write all the CSS code in a css file.
 Its extension must be .css for example style.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">

Department of Computer Engineering Page 3

You might also like