|
|
Inline style sheet
ur
Inline CSS containggh@ 2S property ter dy section
attached with éfément ipline css:-This kind of style
is specified withi
inline css |
|
Inline style sheet
Page3 ——CSS Syntax and Selector
» CSS Syntax and Selector
1. Element 1
2. Id selector
3. Class selector
4. Group sélect@r| i )
Aititon
Sil L fr NTRE. a
The clement selector belee 2 fe TE fe sagcified
Clements Nantes TR AINIMes CENTRE
1, Element Selector
p{
text-align: center;
Color: red;
}
—— PageaId selector
The id selector uses the id attribute of an html element to
select a specific element. The id of an element is unique within
a page, so the id selector is used to select one unique element.
To select an element with a specific id, write a hash (#)
character, followed by the id of the element.
2. 1D Selector
#paral {
text-align: center;
color: red; \
Class selecto}
select eleme:
character, followed GyithkLiani? BS MAERRIESs.
COMPUTER EDUCATION
& xaswen
attribute. To
()
center {
text
color:
)
The css grouping selector is used to select multiple elements
and style them together. This reduces the code and extra effort
to declare common styles for each element. To group selectors,
each selector is separated by a space.
7 Page 5Group Selector
hi, h2, p {
text-align: center;
color: red;
Font-Attributes b: tes
Font-family open ial, Cali - Al eriafifCambria, etc
Font-size s Bs
Font-weight Hariror
Font-style Ha i cy ry
Font-variant ca jor
eu CENTRE
| Hartron Skill Centre
joint), % ercentage)
stitle>font attributes
Hartron Skill Centre
SKILL CENTRE
COM TeXEAtE Utes T! [ N
& TRAINING CENTR
Text-transform uppercase, rare capitalize
Text-decoration underline, overline,line-through
Text-align left, right, center, justify
Text-indent 0.5in (inches)
Letter-spacing px(pixels)
Line-height 2.0,1.5, 1 etc
Page7Direction
Word-spacing 4px, 3px, -Spx, -4px
Text-shadow 2px etc, color(green)
Neo ON s
“then atte cttes
ra
ont tamay Bauhaus 83 fontsice 25pex:
ransom upperraneextalgrentc soe
Secoration underline. letter-spacing 2px. direction itr. word-
spacng tpelerahadee tara e
Hartron Skill Centre
Border attributes
Top border
¢
Margin-left
Margin-right Px,
| Hartron Skill Centre
| [Border attributes
Top border
“" Hartron
evn eeeroc
body(margin-top'S0px:margin-
bottom 50px;margin-left:[Link]-right:25px)
hiffont-tamily: Bauhaus 93;font-
size:25pt;color:red; border-style:solid border.
color: green:border-width:Spx;width:350px}
Hartron Skill Centre
ll Cent
Page9 sareeList-Attributes
Unordered lists () - the list Items are marked with bullets
Ordered lists () - the list tems are marked with numbers or letters
Fae
Re Ordered List
Unordered List
List-style-type
up|
decimal,square,circle,
and . The div tag has a
position attributes that can take one of the two values absolute
or relative.
font attributes
Hartron
Skill
Centre
The padding properti#ark Ls€d Edearierate space around an
element's contefit sin $id DE dnyEdo fined Aor depgThere are
properties for se@ttifigetheliid d ding far GebhTsRIE of an element
(top, right, bottom and left).
a ee
Padding-top %, px, pt
Padding-bottom %, px, pt
Padding-left %, px, pt
Padding-right %, px, pt
Page
crfettmi>
font attributes-ititle>
Hartron Skill Centre
anc®CuBer ts,
of ae
The cursor property of CSS¥a ou'to specify the type of
default, when a
mM a pointer to
hand.
Cursor Htahelp, wait, e-east, move
4 ee ee oe
Hartron Skill Centre
Hartron Skill Centre
Animation
An animation lets an element gradually change from one style
to another. You can change as many CSS properties you want,
as many times you want. To use animation, you must first
specify some key frames for the animation.
Animation property mymove 5s_ infinite
Animation Delay 3s, 2s etc
Animation direction Seay len,
chimi>
etntmi>
Z-Index
Z-index property specifies the stack order of an element. An
element with greater stack order is always in front of an
element with a lower stack order. Z-index only works on
positioned elements (position: absolute, position: relative,
position: fixed or position: sticky)
Page
13
chad
dlile>2-indexcitite>
Ght=Hartron Skill
Centre
Inline Block
Inline-block elements are similar to inline elements, except they
can have padding and margins added on all four sides. You'll
have to declare display: inline-block in your CSS code.
One common use for using inline-block is for creating
navigation links horizontally, I’ve created a horizontal
navigation menu with an orange background color.
{shtml>
|Hartron
internal css [Skill
Shenae: Centre
Hartron Skill Centre Hartron
Skill Centre
S
The float CSS PrépartP placEsharEdbeth chon tte heft or right
side of its contaified, BlaWidd béxXiafid irfirieRefements to wrap
around it. The elements is removed from the normal flow of the
page, though still remaining a part of the flow (in contrast to
absolute positioning)
Page
15intemal css-/tite>
style>
formattwicth 200px height 100px |
float right)
sistyle>
sthead>
ahaaIF =
Setting the widt!
stretching out to-t]
the margins to auto, to
its container. Theelement will ke up the specified width, and
the remainin e, the two
margins:
wall disdoot- dad Wane
This
element has a Th Set to auto
, .
Max-width: Using Taxavidgh fastead; Ethisgsituation, will
improve the browser’s handling of small windows. This is
important when making a site usable on small devices.
This
element has a max-width of S00px,
and margin set to
auto.
— Page —_____
18kehtm>
tite>
This div element has a max-
width of 500px, and margin set to auto.
This div element has a max-
width of S00px, and margin set to auto.
[Ei cements wn of SO mr ao
THO pR and mrgin oT
nied clon hare nw
color, offset (the
distance between, n ths plurradius.
shea TT,
“C.\Users\Administrator\Desktop
Page aeAudio
The auto play attributes is a Boolean attribute, When Present,
the audio will automatically start playing as soon as it can do so
without stopping.
EEE
sstyle>
body{background-color aqua}
audio{margin-left:20px}
Play music herell
“audio sr="audio/yaari_tony_kakkar-
174168¢7-526c-4bbe-bb79-
79¢79224168a,.mp3" controls>Your browser
Not supported audio please updatell
body>
The Hat Qn web page. To
show a video in webpageluke GENTR Element.
CNM DNITED CN Ate
khtmi>
stitle>
poragrapl
paragraph
paragraph 5 in the div
paragraph 1 in the div.
paragraph 2 in the div.
paragraph 4 in the div.
paragraph 6 in the div.
Child selector; T lel nts that are
the children i Cart Ss oO ri
The following examptpigqlegts allE AP ER Bents that are
children of a eter MGSTER EDUCATION
tena
iene paaamee hae
p{background-color-yellow) | *
Shee Jeera in hed
Sinvac>
Siheae |psreroh in ae,
sae fomaeet $n
=p=paragraph 1 in the div.
paragraph 2 in the div.
paragraph 3 in the
div
‘
paragrapn 4 Jn the div.
paragraph 5 in the div.
paragraph 6 in the div.
=intmi>
— a Page
22Adjacent Sibling Selector:
The adjacent sibling selector selects
all elements that are the adjacent siblings of specified
elements.
Sibling elements must have the same parent element, and
“adjacent” means “immediately following”.
The following example selects all
elements that are placed
immediately after
elements.
paragraph 1 in the div
paragraph 4 in the div.
paragraph 1 In the div.
paragraph 2 in the div
paragraph 3 in the div.
paragraph 4 in the div.
KILL =
The followingexanpalpsis qi eck alt Ee clementsythet are siblings
of elements. TRAINING CENTRE
fe Fe) Fer selects all
a ENSRE™ nt.
__ Page
235
The CSS overflow property specifies whether to
clip the content or to add scrollbars when the content of
an element is too big to fit in the specified areaTh
CSS overflow property specifies whether to clip the
content or to add scrollbars when the content of an
element is too big to fit in the specified area
|
| eins
rere ave Fol Ms PEE A,
stle>
|
i
|
Page
38Transform
The transform property applies a 2D or 3D transformation to an
element. This property allows you to rotate, scale, move, skew,
etc., elements.
Rotate
div.a{ Hetty
width: 150px;
height: 80px; ce Your ¢
background-color: yellow"
transform:rotate(20
transform: rotatezodeeh
}div.b {
width:150px;
height:80px;
background-color: yel
transform:
A
i transform: skewY(20deg):
ky
A's): ! a rtr transform: scaleY(1.5):
ve SKILL CENT Cate
COMPUTER EDU:
Shoshotaecn> = & TRAINING