Presentation is loading. Please wait.

Presentation is loading. Please wait.

Advance CSS (Menu and Layout). CSS Navigation MENU.

Similar presentations


Presentation on theme: "Advance CSS (Menu and Layout). CSS Navigation MENU."— Presentation transcript:

1 Advance CSS (Menu and Layout)

2 CSS Navigation MENU

3 Buat File HTML dengan isi Services About us Contact us #nav-menu ul { list-style: none; padding: 0; margin: 0; } Percobaan 1

4 Percobaan 2 Tambahkan pada file HTML setelah tag tadi lihat perubahaannya #nav-menu li { float: left; margin: 0 0.15em; }

5 Displaying the menu items inline To get these menu items all on to one line we'll insert this CSS rule: #nav-menu li { float: left; margin: 0 0.15em; } The float CSS command is the really important one here as that aligns the menu items up against each other. The margin CSS command gives each menu item no margin to the top or bottom and a 0.15em margin to the left and right. Our CSS navigation menu now looks like: Removing the bullets First thing we'll do is remove the bullets, by creating a new CSS rule: #nav-menu ul{ list-style: none; padding: 0; margin: 0; }

6 Percobaan 3 Memisahkan file html dan css Buat file coba.css, pindahkan isi dari tag … dari file html ke file coba.css dan hilangkan tag, simpan kedua file. Tambahkan diawal baris file html

7 #nav-menu ul { list-style: none; padding: 0; margin: 0; } #nav-menu li { float: left; margin: 0 0.15em; } #nav-menu li a { background: url(menu.jpg) #fff bottom left repeat-x; height: 2em; line-height: 2em;float: left; width: 9em;display: block; border:1px solid blue;color: #0d2474;-moz-border-radius:10px; text-decoration: none; text-align: center; } #nav-menu li a { float: none } #nav-menu { width:130em } #nav-menu li a { float: none } #nav-menu { width:130em } #nav-menu li a:link {color: #FF0000} #nav-menu li a:visited {color: #00FF00} #nav-menu li a:hover {color: #FF00FF; background: url(menu1.jpg) #000 bottom left repeat-x;} #nav-menu li a:active {color: #0000FF;} Percobaan 4 - coba.css

8 Percobaan 5 Buat Layout halaman web seperti dibawah ini, gunakan

9 File HTML untuk percobaan 5 Header Column 1 Column 2 Column 3 Footer Percobaan 6

10 File CSS untuk percobaan 5 body { margin:0; padding:0;} #container { margin:0; width:960px; } #container #header { height:100px; background-color:#FFFFCC; text-align:center; font:24px Verdana, Arial, Helvetica, sans-serif; } #container #content { font:12px Verdana, Arial, Helvetica, sans-serif; text-align:center;} #content.col1 { float:left; width:200px; height:400px; background-color:#99CCFF;} #content.col2 {float:left; width:540px;margin-left:10px; background- color:#CC99FF;height:400px;} #content.col3 { float:right; width:200px; background-color:#99FFCC; height:400px; } #container #footer { clear:both; background-color:#996633; font:12px Arial, Helvetica, sans-serif;text-align:center;} Percobaan 7

11 Float property inside the col1, col2 and col3 classes will align the three divs left to right. Note that in the footer I used clear: both. Clear property should be used to clear heights of floating elements. “Both” used to clear right and left floating elements. Here is the result:

12

13


Download ppt "Advance CSS (Menu and Layout). CSS Navigation MENU."

Similar presentations


Ads by Google