CSS
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease
Div HTML
<div id="container">content Tag untuk memuat
<div id="title">content</div> tag lain
<div id="main">content Mirip JPanel
<div id="news">content</div>
</div>
<div id="menu">content</div>
<div
id="footer">content</div></div>
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease
Divs pada CSS
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease
Box Properties
• Background-color
• Border-width
• Width
• Border-color
• Padding
• Border-style
• Margin
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease
17 CSS Colors
• Navy
• Aqua
• Olive
• Black
• Orange
• Blue
• Purple
• Fuchsia
• Red
• Gray
• Silver
• Green
• Teal
• Lime
• White
• Maroon
• Yellow
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease
Box model layout
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease http://weblog.dion.nu/
Background-Color
Warna background
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease
Width
Lebar sebuah elemen
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease
?
Float: (left, right)
#menu { background-color: red; width: 15%; float: left;}
#news { background-color: purple; width: 10%; float: right;}
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease
Clear: (left, right, both)
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease
Border Properties
Border-color Border-style
•Blue •None
•#ff0000 •Solid
•rgb(250,0,255) •Double
•Dotted
•Dashed
Border-width •Groove
•Thin •Ridge
•Medium •Inset
•Thick •Outset
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease
Borders, Examples
Untuk border
dapat
Border-width: medium; dideklarasikan
Border-style: outset; semua atau
Border-color: lime; sebagian
Border-bottom-color: teal;
Border-right-width: thin;
Border-top-style: dashed;
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease
Padding
Padding merupakan spasi antara isi dengan border
Padding bisa digunakan untuk sekeliling isi elemen atau
sebagian saja :padding-right, padding-left, padding-top,
and padding-bottom.
Padding: 1em;
Padding-left: 1em;
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease
Margin
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease
Including Images
• Background-image
• Background-repeat
• Background-position
• Background-attachment
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease
Background-Image
background-image menambahkan gambar pada
backgroud element HTML
main {background-
image:url(mountainsandsky.jpg);}
• Background images and
colors are layered.
• If not transparent, the
last one listed is visible.
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease
Background-Repeat
main {background-
image:url(fairytransparent.gif); background-
repeat:no-repeat;}
repeat
Possible Values
• Repeat
• Repeat-x (horizontal)
• Repeat-y (vertical)
• No-repeat
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease
no-repeat
Layering
Background color dan background image
mirip dengan lapisan kertas. Yang satu
menutupi yang lain
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease
Image Positioning
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease
Background-Position
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease
Background-Attachment
The background-attachment property : fixed
dan scroll
Background-attachment: fixed;
Cascading
CascadingStyle
StyleSheets
Sheets(CSS):
(CSS):Pixel-Level
Pixel-LevelControl
Controlwith
withHTML
HTMLEase
Ease
Tugas
• Membuat HTML (table + form) + Linked CSS