Cascading stylesheets
==================
Cascading style sheets is what makes web pages look good and presentable.
It's an essential part of web development and a must have skill for any web
designer and developer.
*Each property statement must be terminated with a';' semi colon.
Types of style sheet
=================
*Internal style sheet
*External style sheet.
Internal style sheet
================
There are two types
*Inline style sheet
*Multiline style sheet
Selector:
========
A selector is an HTML tag at which a style will be applied. This could be
any tag like <h1> or <table>..etc.
Property:
============
A property is a type of attribute of HTML tag. put simply,all the HTML attributes
are converted into CSS properties. They could be color, border etc.
Multiline style sheet
==================
structure
=========
<html>
<style>
tag
{
attributes;
}
</style>
<body>
we can use the style tag
</body>
</html>
Text tag attributes
==============
*Font-family:font name;
*font-size:no;
*color:#12ff55;
*background-color:color;
*text-decoration:underline/overline/line-through;
*text-alignment:left/right/center
*letter-spacing:no;
*font-weight:bold/italic/regular;
,*text-transform:uppercase/lowercase;
ex-1
======
<html>
<style>
body
{
background-image:URL(f8.jpg);
}
h1
{
font-family:Edwardian Script ITC;
font-size:250;
color:green;
text-align:center;
font-weight:bold;
letter-spacing:10;
background-color:peachpuff;
text-transform:lowercase;
text-decoration:underline;
}
</style>
<body>
<h1>Have a nice day</h1>
</body>
</html>
---------------
Background attributes:
========================
The CSS background properties are used to add background effects for elements.
Atributes
==============
*background-color
*background-image
*background-repeat
*background-attachment
*background-position
Ex:
===
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
background-color: green;
}
div {
background-color: lightblue;
}
,p {
background-color: yellow;
}
</style>
</head>
<body>
<h1>Hai welcome</h1>
<div>Enjoy your life</div>
<p> have a nice day</p>
</body>
</html>
=================================================
HTML <div> tag: The div tag is known as Division tag. The div tag is used in HTML
to make divisions of content on the web page like (text, images, header, footer,
navigation bar, etc). Div tag has both opening(<div>) and closing (</div>) tags and
it is mandatory to close the tag. As we know Div tag is a block-level tag. In this
example, the div tag contains the entire width. It will be displayed div tag each
time on a new line, not on the same line.
-ex:
===
<!DOCTYPE html>
<html>
<head>
<title>Div tag</title>
<style>
div {
color: white;
background-color: #009900;
margin: 2px;
font-size: 25px;
}
</style>
</head>
<body>
<div> div tag </div>
<div> div tag </div>
<div> div tag </div>
<div> div tag </div>
</body>
</html>
===============
HTML <span> tag:
=====================
The HTML span element is a generic inline container for inline elements and
content. It used to group elements for styling purposes (by using the class or id
attributes). A better way to use it when no other semantic element is available.
The span tag is very similar to the div tag, but div is a block-level tag and span
is an inline tag.
ex:
===
<!DOCTYPE html>
, <html>
<head>
<title>span tag</title>
</head>
<body>
<h2>Welcome ToCSC</h2>
<p><span style="background-color:lightgreen">
welcome to csc</span><span style="background-color:purple; color:white;">
is A Computer Science Portal where you can</span>
<span style="color:blue;">
Publish</span> your own <span
style="background-color:lightblue;">articles</span>
<span style="background-color:red;"> and share your knowledge with the
world!!
</p></span>
</body>
</html>
===============================================================
Opacity / Transparency
===========================
The opacity property specifies the opacity/transparency of an element. It can take
a value from 0.0 - 1.0. The lower value, the more transparent:
ex:
====
<!DOCTYPE html>
<html>
<head>
<style>
div {
background-color: peachpuff;
}
div.first {
opacity: 0.1;
}
div.second {
opacity: 0.3;
}
div.third {
opacity: 0.6;
}
</style>
</head>
<body>
<div><h1
<div class=first> welcome</div>
<div class=second> welcome</div>
<div class=third> welcome</div>
</div>
</body>
</html>
==================
Cascading style sheets is what makes web pages look good and presentable.
It's an essential part of web development and a must have skill for any web
designer and developer.
*Each property statement must be terminated with a';' semi colon.
Types of style sheet
=================
*Internal style sheet
*External style sheet.
Internal style sheet
================
There are two types
*Inline style sheet
*Multiline style sheet
Selector:
========
A selector is an HTML tag at which a style will be applied. This could be
any tag like <h1> or <table>..etc.
Property:
============
A property is a type of attribute of HTML tag. put simply,all the HTML attributes
are converted into CSS properties. They could be color, border etc.
Multiline style sheet
==================
structure
=========
<html>
<style>
tag
{
attributes;
}
</style>
<body>
we can use the style tag
</body>
</html>
Text tag attributes
==============
*Font-family:font name;
*font-size:no;
*color:#12ff55;
*background-color:color;
*text-decoration:underline/overline/line-through;
*text-alignment:left/right/center
*letter-spacing:no;
*font-weight:bold/italic/regular;
,*text-transform:uppercase/lowercase;
ex-1
======
<html>
<style>
body
{
background-image:URL(f8.jpg);
}
h1
{
font-family:Edwardian Script ITC;
font-size:250;
color:green;
text-align:center;
font-weight:bold;
letter-spacing:10;
background-color:peachpuff;
text-transform:lowercase;
text-decoration:underline;
}
</style>
<body>
<h1>Have a nice day</h1>
</body>
</html>
---------------
Background attributes:
========================
The CSS background properties are used to add background effects for elements.
Atributes
==============
*background-color
*background-image
*background-repeat
*background-attachment
*background-position
Ex:
===
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
background-color: green;
}
div {
background-color: lightblue;
}
,p {
background-color: yellow;
}
</style>
</head>
<body>
<h1>Hai welcome</h1>
<div>Enjoy your life</div>
<p> have a nice day</p>
</body>
</html>
=================================================
HTML <div> tag: The div tag is known as Division tag. The div tag is used in HTML
to make divisions of content on the web page like (text, images, header, footer,
navigation bar, etc). Div tag has both opening(<div>) and closing (</div>) tags and
it is mandatory to close the tag. As we know Div tag is a block-level tag. In this
example, the div tag contains the entire width. It will be displayed div tag each
time on a new line, not on the same line.
-ex:
===
<!DOCTYPE html>
<html>
<head>
<title>Div tag</title>
<style>
div {
color: white;
background-color: #009900;
margin: 2px;
font-size: 25px;
}
</style>
</head>
<body>
<div> div tag </div>
<div> div tag </div>
<div> div tag </div>
<div> div tag </div>
</body>
</html>
===============
HTML <span> tag:
=====================
The HTML span element is a generic inline container for inline elements and
content. It used to group elements for styling purposes (by using the class or id
attributes). A better way to use it when no other semantic element is available.
The span tag is very similar to the div tag, but div is a block-level tag and span
is an inline tag.
ex:
===
<!DOCTYPE html>
, <html>
<head>
<title>span tag</title>
</head>
<body>
<h2>Welcome ToCSC</h2>
<p><span style="background-color:lightgreen">
welcome to csc</span><span style="background-color:purple; color:white;">
is A Computer Science Portal where you can</span>
<span style="color:blue;">
Publish</span> your own <span
style="background-color:lightblue;">articles</span>
<span style="background-color:red;"> and share your knowledge with the
world!!
</p></span>
</body>
</html>
===============================================================
Opacity / Transparency
===========================
The opacity property specifies the opacity/transparency of an element. It can take
a value from 0.0 - 1.0. The lower value, the more transparent:
ex:
====
<!DOCTYPE html>
<html>
<head>
<style>
div {
background-color: peachpuff;
}
div.first {
opacity: 0.1;
}
div.second {
opacity: 0.3;
}
div.third {
opacity: 0.6;
}
</style>
</head>
<body>
<div><h1
<div class=first> welcome</div>
<div class=second> welcome</div>
<div class=third> welcome</div>
</div>
</body>
</html>