Aptitude (12) ASP.NET (2) Automata (4) Browser (1) C (5) C# (1) C++ (10) Code (3) CSS (1) Data Structure (1) DATABASE (3) HTML (1) java (43) JSP (1) math (1) MySql (8) other (6) php (3) Servlet (3)

Tuesday, 12 June 2012

CSS-Intro


Linking A:
1.      Internal Stylesheet
<html>
<head>
<title><title>
<style type="text/css">
CSS Content Goes Here
</style>
</head>
<body>
</body>
</html>

2.      External Stylesheet

<head>
<title><title>
<link rel="stylesheet" type="text/css"href="style.css" />
</head>
<body>

OR
<head>
<title><title>
<style type="text/css"> @import url(Path To stylesheet.css)
</style>
</head>
<body


CSS Syntax:
   selector { property: value }

Types of selector in CSS:
1.General selector
2.Class selector
3.ID selector
1.General selector
We can use general selector in any part of the file.
Syntax:
Krrish {
         color: Blue;
        font-family: Georgia;
        }
2.Class selector
We  can use the same class selector again and
again within  a file. note that a class selector begins with a (.) period.
Syntax:
.Krrish{
font-size: small;
color: #008080;
font-weight: bold;
}
e.g
<p>
To put it more simply, this <span
class="Krrish">sentence</span> you are reading is styled
in my CSS file by the following.
</p>
3.ID selector
I generally use IDs to style the layout elements of a page that will only
be needed once. id selector begins with a (#) number sign instead
of a (.) period.
Syntax:
#Krrish{
width: 80%;
margin: auto;
}

e.g
<div id="Krrish">
Everything within my document is inside this division.
</div>

No comments:

Post a Comment