Welcome To The: Web Design Class !
Welcome To The: Web Design Class !
What is css
CSS syntax
Css comment
How to use css
Css selectors
Note: A CSS comment starts with /* and ends with */. Comments can also span multiple
lines
/* This is a
multiline
comment */
Inline style
Internal style sheet
External style sheet
<h1 style="color:blue;margin-left:30px;">This is a heading</h1>
h1 {
h1 {
color: maroon;
color: maroon;
margin-left: 40px;
margin-left: 40px;
}
}
</style>
</style>
</head>
</head>
<head>
<link rel="stylesheet" type="text/css" href="my
style.css">
</head>
Note: The style sheet file must be saved with a .css extension
Develop of Universal Software & Research Association http://dusrasoft.com
Css selectors
Universal selector
Element selector
Class selector
Id selector
Grouping selectors
{{
css
css declarations;
declarations;
}}
* {
* {
background-color: yellow;
background-color: yellow;
}}
element {
element {
css
css declarations;
declarations;
}}
p {
p {
background-color: yellow;
background-color: yellow;
}}
.class {
.class {
css
css declarations;
declarations;
}}
.box {
.box {
background-color: yellow;
background-color: yellow;
}}
#box {
#box {
background-color: yellow;
background-color: yellow;
}}
element, element {
element, element {
css
css declarations;
declarations;
}}
h1,
h1, h2,
h2, p {
p {
text-align: center;
text-align: center;
color: red;
color: red;
}}