2 CSS Word File
2 CSS Word File
Define Styles for Your Web Pages, Including The Design, Layout And Variations In Display
For Different Devices And Screen Sizes
HTML was NEVER intended to contain tags for formatting a web page!
With an external style sheet file, you can change the look of an entire website by changing
just one file
Is used to control the style of a web document in a simple and easy way.
Is a simple design language intended to simplify the process of making web pages
presentable?
Advantage of CSS
Easy maintenance
Platform Independence
who Developed
Version
2. CSS2 was became a W3C recommendation in May 1998 and builds on CSS1, support
for media-specific style sheets e.g. printers and aural devices, downloadable fonts,
element positioning and tables.
3. CSS3 was became a W3C recommendation in June 1999 and builds on older versions
CSS
<link> element can be used to include an external style sheet file in your HTML
document
CSS Comments
use /* ....*/ to comment multi-line blocks in similar way you do in C and C++
programming languages.
CSS SYNTAX 3.0
A style rule is made of three parts
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.
VALUE - Values are assigned to properties. For example, color property can have
value either red or #F1F1F1 etc.
CLASS SELECTORS =define style rules based on the class attribute of the elements.
ATTRIBUTE SELECTORS =you can also apply styles to HTML elements with
particular attributes.
GROUPING SELECTORS =you can apply a style to many selectors if you like.
CSS COMMON IMPORATNT SYNTAX 4.0
COLOR VALUE BACKGROUND VALUE CSS FONTS
Hex Code Background-Color Font-Family Property Is
=P{Color:#FF0000;} = Property Is Used To Set Used To Change The Face
The Background Color Of Of A Font.
An Element
RGB % =P{Color:Rgb Background-Image Font-Style
(50%, 50%, 50%) ;} = Property Is Used To Set Property Is Used To Make
The Background Image Of A Font Italic Or Oblique.
An Element
Keyword =P{Color: Background-Repeat Font-Variant
Yellow;} = Property Is Used To Property Is Used To
Control The Repetition Of Create A Small-Caps
An Image In The Effect.
Background.
Background-Position Font-Weight
= Property Is Used To Property Is Used To
Control The Position Of An Increase Or Decrease
Image In The Background How Bold Or Light A Font
Appears.
Background-Attachment Font
=Property Is Used To Property Is Used As
Control The Scrolling Of Shorthand To Specify A
An Image In The Number Of Other Font
Background. Properties
Background
=Property Is Used As A
Shorthand To Specify A
Number Of Other
Background Properties.
Padding=It is
used to set all
the padding
properties in
one declaration.
Practical Session 3.1.2
OUTPUT
BORDER HEIGHT WIDTH OPACITY
CSS border =properties CSS opacity property is used
allow you to specify the to specify the transparency
style, width, and color of an of an element. Example:
element's border
Border styles Height And Width Properties opacity: 0.4;
dotted - Defines a dotted Are Used To Set The Height filter: alpha(opacity=40)
border And Width Of An Element.
Groove - Defines a 3D
grooved border. The effect
depends on the border-color
value
height: 100px;
width: 500px;
Is used to set position for an element. it is also used to place an element behind another
and also useful for scripted animation effect.
STATIC POSITIONING
Default position for HTML elements. It always positions an element according to the normal
flow of the page. It is not affected by the top, bottom, left and right properties.
FIXED POSITIONING
Fixed positioning property helps to put the text fixed on the browser. This fixed test is
positioned relative to the browser window, and doesn't move even you scroll the window.
RELATIVE POSITIONING
Relative positioning property is used to set the element relative to its normal position.
ABSOLUTE POSITIONING
Absolute positioning is used to position an element relative to the first parent element that
has a position other than static. If no such element is found, the containing block is HTML.
PROPERTIES
OUTPUT:
Practical Session 4.2.0
OUTPUT:
Practical Session 4.3.0
OUTPUT:
CSS IMPORTANT QUESTIONS 5.0