HTML With CSS

CSS stands for Cascading Style Sheets.CSS describes how HTML elements are to be displayed on screen,paper,or in other media.CSS save a lot of work.it can control the layout of multiple web pages all at once.css can be added to HTML elements in 3 ways.

      Inline

      Internal

      External


Inline CSS

Inline CSS is used to apply a unique style to a single HTML element.an inline CSS uses the style attribute of an HTML element.the following example sets the text color of the <p> element to red.

Example


<p style ="color:red;" >Welcome to Veewom </p> 
							

Internal CSS

Internal CSS is used to define a style for a single HTML pages.an internal CSS is defined in the <head> section of an HTML page,within a <style> element.

Example


<html>
<head>
	<title>Internal CSS</title>
<style>
.p1{color:red;}
h4{color:green;}
</style>
</head>
<body>
<h4>Veewom</h4>
<p class="p1">Welcome to Veewom</p>
</body>
</html>
							

Output

Internal CSS

Veewom

Welcome to Veewom


External CSS

External style sheet is used to define the style for many HTML pages.to use an external style sheet,add a link to it in the <head> section of the HTML page

styles.css

.cl
{
	color:red;
	text-align:center;
	font-size:20px;
}
							

index.html


<html>
<head>
	<title>External CSS</title>
	<link rel="stylesheet" href="styles.css">
</head>
<body>
<p class="cl">VirtualHax</p>
</body>
</html>
							
Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit

You may also like this!