Download
    Interview Question     &Answer
Main Menu
CSS Tutorial@ Shwetank education.com
Defination-  CSS (Cascading Style Sheet) . It is used to change html element style.
Three Ways to Insert CSS
External style sheet
Internal style sheet
Inline style

1 - External CSS-
An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. Each page must link to the style sheet using the tag. The tag goes inside the head section

Syntax
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>
2- Internal CSS
An internal style sheet should be used when a single document has a unique style. You define internal styles in the head section of an HTML page, by using the ,<style> tag, like this

Example
<head<<
style type="text/css">
hr {color:sienna;}
p {margin-left:20px;}
<body>
{background-image:url("images/back40.gif");}
</style<
</head>
Inline CSS
To use inline styles you use the style attribute in the relevant tag. The style attribute can contain any CSS property. The example shows how to change the color and the left margin of a paragraph

Example
<p style="color:sienna;margin-left:20px">This is a paragraph.</p>

DIV Tag
Syntax <div> </div>
The <div> tag defines a division or a section in an HTML document.
The <div>tag is often used to group block-elements to format them with styles.

CSS Id and Class
CSS ID
The id selector is used to specify a style for a single, unique element.
The id selector uses the id attribute of the HTML element, and is defined with a "#".
Example
#nav{margin-left:20px;}
CSS Class
This allows you to set a particular style for many HTML elements with the same class.
The class selector uses the HTML class attribute, and is defined with a "."
Example
.nav{margin-left:20px;}


IT  Projects Links
M-Tech Thesis
Php Project
Java Project
Asp.Net Project
Android Project
Vb .Net Project
Html Project

------------------------------- Electronics  Project
Networking
Embedded system
Telecom
Robotics
CCNA
------------------------------- Latest IT  News


Copyright 2010-2015    shwetankeducation.com
Privacy & Terms