CSS Bangla Ebook by Faruk
CSS Bangla Ebook by Faruk
ee d
;
< ee e ei&ee e =
5 !o #5>n
@ A4 ee ( . m4., i restyle
ee 6B;
ee e 6B d a+ , 6 e k e+ an e
e ( & F 6B &t #o -
Declaration={Properties: Value}
/ ( 0;
ei&ee- e k e( CSS 0 ! ee
M i .CSS Extension # , r
<.i* ee;
i* ee F 0i 0 e ei&ee (k* n
e ( i # i* ee- e <head> 6 , <style> 6 #
ee ( 6 -
p#.:
White text on a black background!
@.ek . ee;
& , # ! ee ei&ee 5/ 0, !
e i ek . ee 0 e ee ( a (k* n
0 ek . ee ut ek . ee e ee
M i <head> 6 , <link> 6 # +4k <head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>
Z.i i ee;
(k* p HTML 6 / Style eTu (k*
s i . F i i i ee i i ee kt Style
#. # Type Attribute ( p e+ d
n
{} e # ud &h & u# F #04-
b ((\) ;
b
i. sTe , b / e+ i n i / iu
e* i k eg &
ii. s ee k i s i (
b e ; \ # (
j
iii. k i (k* g
n b # e
b;
b;
Property
1.color
Description
k e . F
2.direction
3.letterspacing
4.line-height
5.text-align
6.textdecoration
10.verticalalign
rtl
3. letter-spacing Property:
ee letter-spacing property e e k characters
g space e g
10
4. line-height Property:
d i j F M q s / #. ei p .
Negative values are not allowed.
ei p . h e<. m (ekt i un M* i / g
)
@. i un px, pt, cm e F.
Z. (%) i un h M* i k
11
6.text-decoration property:
ei p . k ,n, p#. text-decoration
property & s !*( i #i -
!u4;
F.
k #. e (Ml
underline
overline
k o, i
linethrough
k j # 6
blink
7.text-indent property:
ee text-indent ! ei&ee (<pre>) 6 .
values or percentages ! text-indent #.>
text indent 0 # / 4k A g # Vr e
=#_(em,ex,pt) o (%) h ee (;
12
p { text-indent: 20px; }
h5 { text-indent: 30%; }
p#.:
8.text-shadow property:
k 7 ( eMk p 6 #. ei p .
# e #. e, -
Description
none
10.Vertical-align property:
k ul e i* #. ei p .
Vertical-align property g Value
Description
length
baseline
sub
super
top
text-top
middle
bottom
textbottom
14
F.
Sequences of whitespace will collapse into a single whitespace. Text will
wrap when necessary. This is default
Sequences of whitespace will collapse into a single whitespace. Text will
never wrap to the next line. The text continues on the same line until a <br
/> tag is encountered
Whitespace is preserved by the browser. Text will only wrap on line breaks
Acts like the <pre> tag in HTML
15
pre-line
pre-wrap
p { word-spacing: 10px; }
p#.:
16
17
F.
1.height
2.max-height
3.max-width
4.min-height
5.min-width
6.width
auto
length
%
none
length
%
none
length
%
length
%
length
%
auto
length
%
u ei A p . p .i padding, borders e+ margins i p .
h ,4 g o F. m #o None No maximum height, maximum width. This is default
Auto The browser calculates the height. This is default
Length px, cm e
% Defines the minimum width in percent of the containing block
, m e# ! & ;
1+6.CSS height and width Property:
e* height o width F. ei p . d d -
18
19
20
21
F.
1.font
2.font-family
3.font-size
4.font-style
5.font-variant
6.font-weight
22
font- property kt ei k a7i & ; font-style
font-variant font-weight font-size/line-height font-familyfontsize e+ font-family p . -
F.
Uses the font that are used by captioned controls (like buttons,
drop-downs, etc.)
Uses the font that are used by icon labels
Uses the fonts that are used by dropdown menus
Uses the fonts that are used by dialog boxes
A smaller version of the caption font
Uses the fonts that are used by the status bar
2.font-family Property:
23
M* M M* gr & #. e
p . -
3. font-size Property:
M* ! . F font-size p . ei p . n &
F - a s, !k, o =#_.
a s i;
24
!k
!
k i; k i . s 6 #
! # font size specify # (Ml M* i i #0 ! ei
(Ml i - 16px (16px=1em).
font size property-
-,4
F.
a s
xx-small
M* i xx-small i
x-small
M* i extra small i
small
M* i small i
medium
M* i medium size. e (Ml
large
M* i large size
x-large
M* i extra large size
xx-large
M* i xx-large size
!k ; !6 u # k . u # ! A g /
/
smaller
parent e* & A ! M* ei
larger
parent e* & g ! M* ei
=#_.
length
d> i M* px, cm, etc e
%
parent e* k M* i . F
0 default M* . & 0 Percentages , nt
static value u& u# F-
25
F.
s , M*M #0 e default
i #0
M*M Oblique , . #0
5.font-variant property:
font-variant property . F ! M* small-caps- e #0 #0
ee M* Variant e ! M* small caps e .
Note: nt M*, ee M* Variant .
i p !6 ~ u&small-caps font- uppercase letters- e
. nt uppercase letters g small-caps font e ! i
#0
,4
normal
small-caps
F.
The browser displays a normal font. This is default
The browser displays a small-caps font
26
Description
Defines normal characters. This is default
Defines thick characters
Defines thicker characters
Defines lighter characters
Defines from thin to thick characters. 400 is the same as normal, and 700 is
the same as bold
27
font-stretch property:
M* i , (n( #. e p . e
- normal, wider, narrower, ultra-condensed, extra- condensed ,
condensed , semi- condensed, semi-expanded, extra-expanded,e+ ultraexpanded u # /i e h
28
29
F.
list-style property e ( i list properties 4
list-style-image property s !i i d p
list-style-position property . F s !ig s ,
as / inside Outside- e /
default number- e ordered unordered s e bullets/discs
,n s i
1.list-style property:
list-style property e ( i list properties 4 !
ei list-style-type e e e s 0 ! liststyle image ( 0 an list-style #0 list-style shorthand
property k list-style-type list-style-position list-style-image
# p . ,4 # s ekt ] p . (Ml ,4
o - list-style: circle inside;
30
Output:
2.list-style-image property:
i list item marker #0 list-style-image property
list-style-image property s !i i d p
. F i ( ei p . F image
31
32
( baF;
!a( ( s ns !i &h #i list-style-type- e ,4 none #o A padding
e+ margin e ,4 0px A
s ni (no-repeat) i B # (left 0px
and down 5px) padding-left s k as B #
url
none
i
i p#. 4j
3. list-style-position property:
list-style-position property . F s !ig s , as
/ inside Outside- e / list-style-position e ,4 inside #
0 sg . , # / ! Outside # normal s
Position e / Outside ,4 e default , 4
ul { list-style-position: inside; }
ol { list-style-position: outside; }
e u# F #04;
33
4. list-style-type property:
ol { list-style-type: upper-roman; }
ul { list-style-type: circle; }
34
Output:
35
F.
Armenian numbering &h p
Circle &h p
plain ideographic numbers &h p
s , m p e <ol> e n (Ml
m Vr / (01, 02, 03, i #.)
, 5t p e <ul> e n (Ml
Georgian numbering &h p
Hebrew numbering &h p
Hiragana numbering &h p
Hiragana iroha numbering &h p
Katakana numbering &h p
Katakana iroha numbering &h p
A ak p (a, b, c, d, e i #)
A g
ak p
A ak p (a, b, c, d, e, i #)
A ak p (i, ii, iii, iv, v, i #)
&h #0
36
square
upper-alpha
upper-latin
upper-roman
37
38
a:linke F + ,
a:visitede + i. , A
a:hovere e + u 0 / / ,4 iMk #0
a:activee e + . k !A an, iu 0
+ k n n ak iMk
39
u 0
40
41
42
43
44
45
46
F.
background properties- e (
4
2.backgroundattachment
3.background-color
4.background-image
5.background-position
6.background-repeat
1. background Property:
background p background properties- e (
4 background p a(. - backgroundcolorbackground-imagebackground-repeatbackground-attachment ,
background-position. e# ,4 # g s i background:#ff0000 url('smiley.gif');
47
2. background-attachment Property:
background-attachment property . F sk+- e / /
background i fixed / / / sk !
48
,4
scroll
F.
g u*( io sk / / sk e (Ml .
fixed
3. background-color Property:
background-color property e* background color . F
e* g u*( ] e* i , padding e+ border
an,4.k / nt margin / F background color e+ text color
e / background-color p . / k , g
49
div {background-color:#b0c4de;}
4.background-image Property:
background-image property e* gu*( i
url('URL')
none
i 'URL'
gu*( i / e (Ml
5. background-position Property:
g u*( i B s s #o
background-position Property e
- =#_. , o o (. =#_./ps
as #. n - %% ] i b u ui*(
e# u as ! %%
as nd =#_. i ( 4em 50%) Vertical
as #.
o (. !n,i m .
_ , kt as F
o (.g
(Top, Middle, Bottom) um (vertical) as #., ! an (Left,
Right, Center) !n,i as #. Body{background-position: top left}
e ( an, o 0
Body{background-position: left top}
, Body{background-position: % %}
,4
F.
o (.
left top
left center
left bottom
right top
right center
51
right bottom
center top
center center
center bottom
x% y%
=#_.
xpos ypos
52
6. background-repeat Property:
g u*( i repeat , # F
. F CSS-e background-repeat p . backgroundrepeat p . m g ,4
F.
repeat
repeat-x
& ( M e i ei / vertically and horizontally
53
54
55
1.Static Positioning
2.Fixed Positioning
3. Relative Positioning
4. Absolute Positioning
u# F m ! & ;
1.Static Positioning:
HTML e*g static positioned e static
positioned element (k* k s
left o top p . # static positioned p .g top, bottom,
left, e+ right p . d p,
2.Fixed Positioning:
e e* # Mk( # b u ui*(
k as e+ b u # sk 4o s (fixed) /
normal flow Fixed positioned elements g #i #o Fixed positioned
elements g an n e* overlap
56
3. Relative Positioning:
Relative position d ei&ee e* e position an e* e
k . e anO# j / <B>, <I>
i # u # e0 <p> i u # , ! <B>, <I> & il e0
<B> e kt position: relative as <p> e
k, 4 ui*( k relatively positioned e* u # g
e0 ! ! u# F #0 0 u # p/ & il
d
, d
& il 5
e+ u # , (
58
Output:
59
!o A4;
h3 {
position: relative;
top: 15px;
left: 150px;
}
p {
position: relative;
left: -10px;
}
Move Left - ekt left e n negative value
Move Right - ekt left e n positive value
Move Up -
h3 {
position: absolute;
top: 50px;
60
left: 45px;
}
p{
position: absolute;
top: 75px;
left: 75px;
}
! u# :
Output:
61
s:
mk, u # + -
;
b k M +, i i u # i i ,
i t a/ b k , + e+ k o - i k
;
( k p/ s e+
i / ( ! u # an n
* /
a s +:
a s e u # 44 / !
e+ #. s s e (k* p, ei
+ ee e p .
ee-- e h Positioning Properties:
ee
p .
F.
h
auto
1.bottom
2.clip
u # a+ #57
shape
. F Clip
auto
p .
length
%
url
3.cursor
62
auto
crosshair
default
pointer
move
e-resize
ne-resize
nw-resize
n-resize
se-resize
sw-resize
s-resize
w-resize
text
wait
help
4.left
5.overflow
6.position
absolute
p . e e* n fixed
F positioning method relative
. F
static
inherit
auto
length
%
auto
hidden
scroll
visible
inherit
auto
7.right
8.top
length
%
inherit
9.z-index
63
number
auto
inherit
Output:
64
2.Clip Property:
u # a+ #57 . F Clip p .
i i a g 4k #0 ei p .
. F e k Clip: sClip
e0 sClip e dshape e e* k - rect (top, right, bottom, left)
auto
p { cursor: wait }
h4 { cursor: help }
h5 { cursor: crosshair }
. URL o 0 P{cursor: url(sajkdg.cur) url(sdjg.cur),text}
auto
inherit
crosshair
default
help
move
pointer
progress
text
wait
e-resize
ne-resize
nw-resize
n-resize
se-resize
sw-resize
s-resize
w-resize
66
67
5.Overflow Property:
# e* * k j e* * _
. F overflow p . an, - top left, height o
width p . . F5 k j *
. F overflow p . ei p . & visible
68
69
b u
& u# F #0 A
, b
u automatically overflow t
-
70
absolute
fixed
relative
71
72
73
9.Z-index Property:
! #0A position: absolute e / left o top p . ,n
u # o, ,n u # o,
!6 ! #0 #. Z-index
p . An element with greater stack order is always in front of an
element with a lower stack order. -
74
p#.;
e0 three (, z-index an (, & e
u #0 z-index only works on positioned elements
(position:absolute, position:relative, or position:fixed).
z-index p . di F auto
number Sets the stack order of the element. Negative numbers are allowed
Output:
Note: If two positioned elements overlap, without a z-index specified, the element
positioned last in the HTML code will be shown on top.
z-index !o A4 / e ! #0 e* u #0 ,
ee e ! nt ee e p
e* priority # / # d overlapping CSS
positioned elements / , priority !6 u #0
Priority . ! z-index value / z-index value
priority
76
h4{
position: relative;
top: 30px;
left: 50px;
z-index: 2;
background-color: #336699;
}
p {
position: relative;
z-index: 1;
background-color: #FFCCCC;
}
p#.:
77
u
78
u
float property o ! e* as B
-
79
u
u !u4 i
80
81
gu*( d p,
gu*( d p,
82
83
F.
margin property e property- !
margin shorthand property ("margin")
margin-right
margin-top
k &
o
o
o
o
( ;
margin:25px 50px;
o top and bottom margins are 25px
o right and left margins are 50px
margin:25px;
o all four margins are 25px
85
86
2. Border Property:
ei&ee e* e & (. #0 ee (. e
m4,
. customize (style, color)
87
F.
border shorthand property ("border":) border
properties- e ( p
2.border-bottom
3.border-bottomcolor
4.border-bottomstyle
5.border-bottomwidth
6.border-color
7.border-left
11.border-right
12.border-rightcolor
13.border-rightstyle
14.border-rightwidth
15.border-style
16.border-top
88
1.border property:
Border - Shorthand property
border shorthand property ("border":) border properties- e
( p ( k border-width>borderstyle>border-color , 4 # g s i
2.border-bottom property:
border-bottom shorthand property(border-bottom:) bottom border
properties- e ( p ( k
border-bottom-width>border-bottom-style> border-bottom-color. , 4
# g s i
89
3.border-bottom-color:
border-bottom-color property e* bottom border- e . F
4.border-bottom-style property:
border-bottom-style property e* (. bottom a+ s i . F
90
5.border-bottom-width property:
border-bottom-width property e* (. bottom a+ ps
. F
Property Values
Value
thin
medium
thick
length
Description
Specifies a thin bottom border
Specifies a medium bottom border. This is default
Specifies a thick bottom border
Allows you to define the thickness of the bottom border
6.border-color property:
91
border-color:red;
o all four borders are red
92
7.border-left property:
border-left shorthand property left border properties e
( p ( k border-leftwidthborder-left-styleborder-left-color. It does not matter if one of
the values above are missing, e.g. border-left:solid #ff0000; is allowed.
8.border-left-color property:
border-left-color property sets the color of an element's left border.
transparent :Specifies that the border color should be transparent. This is
default
93
9.border-left-style property:
The border-left-style property sets the style of an element's left border.
border-bottom-style property border-leftstyle property-o i
10.border-left-width property:
e border-bottom-width property e i
11.border-right property:
e border-left property- e i
94
12.border-right-color property:
e border-left-color property- e i
13.border-right-style property:
14.border-right-width property:
e border-bottom-width property o border-left-width
property e i
15..border-style Properties:
15
(. s i border-style:- e p ,4 g
mr;
,4
F.
none
(. #0
hidden
The same as "none", except in border conflict resolution for table elements
dotted
e dotted border #0
dashed
e dashed border #0
solid
e solid border #0
double
e double border #0
groove
3D grooved border #0 iMk border-color- e u ,.
ridge
3D ridged border #0 iMk border-color- e u ,.
inset
3D inset border #0 iMk border-color- e u ,.
outset
3D outset border #0 iMk border-color- e u ,.
m u# F #0 ;
95
96
border-style:dotted solid;
o top and bottom borders are dotted
o right and left borders are solid
97
border-style:dotted;
o all four borders are dotted
Output:
16.border-top property:
The border-top shorthand property sets all the top border properties in one
declaration.k ; border-top-width border-top-style border-topcolor.If one of the values above are missing, e.g. border-top:solid #ff0000,
the default value for the missing property will be inserted, if any.
98
17.border-top-color property:
e border-left-color property: e i
<style type="text/css">
p
{
border-style:solid;
border-top-color:#ff0000;
}
</style>
18.border-top-style property:
e border-bottom-style property o border-left-style property-e
19.border-top-width property:
e border-bottom-width property e
20..border
border-- width property
property::
20
(. ps . F border-width property "border-width"
property e, , e / "border-style" property
, p/ (k e di, (M i - <.k @. predefined values pre-defined value g ;
, 4
thin
medium
thick
length
F.
thin border #.
medium border #. e default
thick border #.
iO #o
99
kt border-style- e p 6 #04table { border-color: rgb( 100, 100, 255);
border-style: dashed; }
td { border-color: #FFBD32;
border-style: ridge; }
p { border-color: blue;
border-style: solid; }
100
3.CSS Padding:
Padding:
ee (+ j e* e border e+ content e
a+ee (+ ! ei&ee e*
(paragraphs, tables i # ) e default (+ .
Padding e u background color e p, A
Description
1.padding
4.padding-right
5.padding-top
101
padding:10px 5px;
o top and bottom padding are 10px
o right and left padding are 5px
padding:10px;
o all four paddings are 10px
102
CSS Outlines:
An outline is a line that is drawn around elements, outside the border edge,
to make the element "stand out".The outline properties specifies the style,
color, and width of an outline. An outline is a line around an element. It is displayed
around the margin of the element.it is different from the border property.
F.
Sets all the outline properties in one
declaration
,4
outline-color
outline-style
outline-width
color_name
hex_number
rgb_number
invert
none
dotted
dashed
solid
double
groove
ridge
inset
outset
thin
medium
thick
length
, m e# F. #o ;
104
105
Property Values
Value
none
dotted
dashed
solid
double
groove
ridge
inset
outset
Description
Specifies no outline
Specifies a dotted outline
Specifies a dashed outline
Specifies a solid outline
Specifies a double outliner
Specifies a 3D grooved outline. The effect depends on the outline-color
value
Specifies a 3D ridged outline. The effect depends on the outline-color value
Specifies a 3D inset outline. The effect depends on the outline-color value
Specifies a 3D outset outline. The effect depends on the outline-color value
106
Property Values
Value
thin
medium
thick
length
Description
Specifies a thin outline
Specifies a medium outline. This is default
Specifies a thick outline
Allows you to define the thickness of the outline
107
108
Collapse Borders:
109
110
The vertical-align property sets the vertical alignment, like top, bottom, or
middle:
111
Table Padding:
To control the space between the border and content in a table, use the
padding property on td and th elements:
112
Table Color:
The example below specifies the color of the borders, and the text and
background color of th elements:
113
114
115
116
Output:
117
118
119
120
Output:
F.
1.clear
,4
left
right
both
an u # float
2.float
none
left
Specifies whether or not a box should
right
float
none
122
123
!u4;
124
Description
The element floats to the left
The element floats the right
The element is not floated, and will be displayed just where it occurs in the
text. This is default
125
p#.:
126
127
!u4;
128
p#.:
Let the first letter of a paragraph float to the left and style the letter.
129
130
Output:
131
132
h4{background-color:white;font-size:12px;}
p{color:red;}
e0 h4, p e O k,h4 e d ei&ee <h4></h4>
e , !A k h4 e* k h4 e
*( b 0 / Vr A e+ p e !6 0 *( b
133
134
**! # k e / . & i k
A g V4 Class ;
. first{ color: blue; }
. i k:
color:red;
}
ei&ee M i
138
139
140
141
The example below styles all elements with a lang attribute that contains a
specified value. This works even if the attribute has hyphen ( - ) separated
values:
Styling Forms
The attribute selectors are particularly useful for styling forms without
class or ID:
142
</style>
e0 h1 k n ( # A e (
gr p e, <style type=text/css>
H1{color : red; font-family : Arial, Arial black; font-size : 16pt }
</style>
;d; k gr 6B ki 5/ (,) # e+
( gr 6B 5/ (;) #
r ! e (, (div)e !i( O menu (id="menu") !
ei (, , + e+ (+ e + & O 0 e,
#menu a, #menu h1,#menu h2, #menu h3{
color:red;
}
! # #menu a,h1,h2... e, 0 ,4
10.Nesting Selectors:
It is possible to apply a style for a selector within a selector. In the example
below, one style is specified for all p elements, and a separate style is
specified for p elements nested within the "marked" class:
144
Selector
1):link
2):visited
3):active
4):hover
5):focus
6):first-letter
Example
a:link
a:visited
a:active
a:hover
input:focus
p:firstletter
Example description
Selects all unvisited links
Selects all visited links
Selects the active link
Selects links on mouse over
Selects the input element which has focus
Selects the first letter of every <p> element
145
7):first-line
8):first-child
p:first-child
9):before
p:before
10):after
p:after
11):lang(language) p:lang(it)
CSS Pseudo-classes
CSS pseudo-classes k s iMk #o Class e
i Pseudo-Class (k* ,n k . F
(k* i e u # s i n u( e* o u(
k
CSS pseudo class- e F 6BSelector: pseudo class {property: value;}
ee k pseudo class- e / Selector. Class: pseudo class {property: value;}
a. red: visited {color: #001122}
146
lang Pseudo-class::
,n , a n a A4 . F lang pseudo-class
& u# F lang class q element- e &h #o
A lang="no"- e
147
148
149
Tip: The :focus selector is allowed on elements that accept keyboard events
or other user inputs
font properties
color properties
background properties
margin properties
padding properties
border properties
150
text-decoration
vertical-align (only if float is 'none')
text-transform
line-height
float
clear
font properties
color properties
background properties
word-spacing
letter-spacing
text-decoration
vertical-align
text-transform
line-height
clear
151
152
Output:
Output:
153
Output:
155
Output:
OUTPUT:
156
CSS Pseudo-elements
CSS pseudo-elements- A4 k special effects #o
CSS pseudo-elements- e F 6B Selector: pseudo-element {property: value;}
ee class- pseudo-elements- e / Selector.class: pseudo-element {property: value;}
First-line Pseudo Element:
First-line Pseudo Element e g M p/ i .
s i #0 P:first-line{font-style:bold}
e M p g M p/ i l #0
font properties
color properties
background properties
word-spacing
letter-spacing
157
text-decoration
vertical-align
text-transform
line-height
clear
u
font properties
color properties
background properties
margin properties
padding properties
border properties
text-decoration
vertical-align (only if "float" is "none")
text-transform
line-height
float
clear
0 g small-caps- e #0 O
159
160
161
162
163
!u4;
164
!u4;
Visibility Property:
u # b u #0 (visible), #0 (hidden) . F
visibility p . e d -visible
] u # #57 , ! hidden #0
visibility:hidden ] u # #0 6o n F
6 d !A M q #0 a/. Y !u u p, /
display :none i u # #0 e+ s #0
an u # display p . / visibility p . /. e0 i &
u# F e #0 -
165
!u4;
166
167
Example
ul
{
list-style-type:none;
margin:0;
padding:0;
}
Try it yourself online a dekte hohe
Example explained:
list-style-type:none - Removes the bullets. A navigation bar does not need list
markers
Setting margins and padding to 0 to remove browser default settings
The code in the example above is the standard code used in both vertical, and horizontal
navigation bars.
168
Example
a
{
display:block;
width:60px;
}
Try it yourself online a dekte hohe
Example explained:
display:block - Displaying the links as block elements makes the whole link area
clickable (not just the text), and it allows us to specify the width
width:60px - Block elements take up the full width available by default. We want
to specify a 60 px width
Tip: Also take a look at our fully styled vertical navigation bar example.given below
<html>
<head>
<style type="text/css">
ul
{
list-style-type:none;
margin:0;
padding:0;
}
a:link,a:visited
{
display:block;
font-weight:bold;
color:#FFFFFF;
169
background-color:#98bf21;
width:120px;
text-align:center;
padding:4px;
text-decoration:none;
text-transform:uppercase;
}
a:hover,a:active
{
background-color:#7A991A;
}
</style>
</head>
<body>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#news">News</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
</body>
</html>
170
Note: Always specify the width for <a> elements in a vertical navigation bar. If you omit
the width, IE6 can produce unexpected results.
Example
li
{
display:inline;
}
Try it yourself online a dekte hohe
Example explained:
Tip: Also take a look at our fully styled horizontal navigation bar example. Online a
dekte hobe
171
Example
li
{
float:left;
}
a
{
display:block;
width:60px;
}
Try it yourself online
Example explained:
float:left - use float to get block elements to slide next to each other
display:block - Displaying the links as block elements makes the whole link area
clickable (not just the text), and it allows us to specify the width
width:60px - Since block elements take up the full width available, they cannot
float next to each other. We specify the width of the links to 60px
172
h ei&ee (-
============The End===========
173