Anda di halaman 1dari 13

CSS

FUNDAMENTALS

Guided by: Prepared by :


Mr. Harendra Santosh Singh Bisht
negi BCA 6th A
46
Content
 What is CSS?
 CSS Rule syntax
 HTML & CSS
 HTML without CSS
 Selectors
 Properties and values
 Comments in CSS
 Advantages
 disadvantages
What is CSS?
CSS stands for Cascading Style Sheet.
Cascading style sheet is one of the “big three”
languages of the web. It’s used to style text, images,
and other page elements, and control their positioning
on web pages.
CSS is easy to learn and understand but it provides
powerful control over the presentation of an HTML
document. Most commonly, CSS is combined with the
markup languages HTML and XHTML.
CSS Rule Syntax
A CSS RULE is made up of a selector and a
declaration. A declaration consists of property
and value.

selector { property : value }


declaration

Example :- body { background: purple; }


HTML & CSS
 HTML and CSS works together to produce
beautiful and functional web sites.
 HTML = structure
 CSS = style
HTML without CSS

With CSS Without CSS

Without CSS, HTML elements typically flow from top to bottom of


the page and position themselves to the left by default.

With CSS help, we can create containers or DIV’s to better


organize content and make a web page visually appealing.
Selector
s
A selector is an HTML tag at which a style will be
applied. This could be any tag like <h1> or
<table> etc.
body { property: value; }
h1 { property: value; }
em { property: value; }
p { property: value; }
Properties and values
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.

Value : Values are assigned to properties.


For example, color property can have either red or #f1f1f1 etc.

body { background: people; }


h1 { color: green; }
h2 { font–size: large; }
P {color: #ff0000; }

Properties and values tell an HTML elements how to display.

body { background: purple; color: green ; }


Comments in CSS
 Explain the purpose of the coding.
 Help others read and understand the code.
 Serve as a reminder to you for what it all means.
 Starts with /*…. and ends with */ in similar way you
do in C and C++ programming languages.

p { color: #ff0000; } /* ……….. */


There are 3 ways to attach CSS to a
page :
1. External style sheet:
Best used to control styling on multiple
pages.
2. Internal style sheet:
Best used to control styling on one page.
3. Inline style sheet :
CSS is not attached in the <header> but is
used directly within HTML tags.
ADVANTAGES
 CSS saves time.
 pages load faster.
 Easy maintenance.
 Superior styles to HTML.
 Easy to learn
DISADVANTAGES
 Come in different levels
 Fragmentation
 Lack of security
THANKYOU

Anda mungkin juga menyukai