Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cool Menu, dengan css sprite
#1
Yap...ketemu lagi dengan postingan ane, mudah-mudahan sobat2 HN kagak pada bosen...

scrensutnya:

[Image: cssSprite5.png]

kalo mau liat yang bisa gerak disini

Download source image : icon.png

Buka NOtepad, copy/ketik kode di bawah:

======================================

<html>
<head>

<style type="text/css">

#foot-outer {
width:auto;
height:82px;
background:#F7F8F9;
border:1px solid orange;
background:url(icon.png) no-repeat 0 -422px;
}

#foot-outer:hover {
width:auto;
height:82px;
background:#F7F8F9;
border:1px solid orange;
background:url(icon.png) no-repeat 0 -509px;
}


#foot-menu {
float:left;
width:500px;
margin-top:4px;
border:1px solid green;
}


ul#foot-menu{
margin:0; padding:0;
}

ul#foot-menu li {
list-style-type:none;
width:72px;
height:72px;
float:left;
margin:0;
}

ul#foot-menu li a{
text-indent: -9999px;
margin-left:3px;
float:left;
}

ul#foot-menu li#home a{
width: 71px;
height:71px;
border:1px solid red;
background: url(icon.png)no-repeat -73px -78px;
}

ul#foot-menu li#home a:hover{
width: 117px;
height:117px;
position:relative;
z-index:6;
background: url(icon.png) no-repeat -129px -305px;
}

ul#foot-menu li#link a{
width: 71px;
height:71px;
border:1px solid red;
background: url(icon.png) no-repeat 4px -75px;
}

ul#foot-menu li#link a:hover{
width: 117px;
height:117px;
position:relative;
z-index:6;
border:1px solid red;
background: url(icon.png) no-repeat 2px -300px;
}

ul#foot-menu li#label a{
width: 71px;
height:71px;
border:1px solid red;
background: url(icon.png) no-repeat -149px 3px;
}

ul#foot-menu li#label a:hover{
width: 117px;
height:117px;
position:relative;
z-index:6;
background: url(icon.png) no-repeat -258px -168px;
}

ul#foot-menu li#game a{
width: 71px;
height:71px;
border:1px solid red;
background: url(icon.png) no-repeat -72px 4px;
}

ul#foot-menu li#game a:hover{
width: 117px;
height:117px;
border:1px solid red;
position:relative;
z-index:6;
background: url(icon.png) no-repeat -125px -165px;
}

ul#foot-menu li#fb a{
width: 71px;
height:71px;
border:1px solid red;
background: url(icon.png) no-repeat 3px 4px;
}

ul#foot-menu li#fb a:hover{
width: 117px;
height:117px;
position:relative;
z-index:6;
background: url(icon.png) no-repeat 3px -166px;
}

</style>

</head>

<body>

<div id="foot-outer">
<div id="foot-menu">
<ul id="foot-menu">
<li id="home"><a href="#" title="Home">kkk</a></li>
<li id="link"><a href="#" title="Link">kkk</a></li>
<li id="label"><a href="#" title="Download">kkk</a></li>
<li id="game"><a href="#" title="Game">kkk</a></li>
<li id="fb"><a href="#" title="Add my Facebook">kkk</a></li>

</ul>
</div>
</div>

</body>

</html>

======================================

Simpan kode di atas dengan type .Html (index.html), harus 1 tempat ama source image yang udah di download tadi (icon.png)

Nah kalo untuk mengetahui posisi gambar (x,y), misal ane ambil contoh gambar Home.
background: url(icon.png) no-repeat -73px -78px.

  1. Buka icon.png di Photoshop

  2. Klik Measure Tool (I) >> pilih Info pada Pallete Navigator >> klik icon panah di pojok kanan atas >> pilih pallete options >> ubah Ruler Units pada Mouse coordinates menjadi satuannya Pixels >> kemudian klik tombol OK

    [Image: cssSprite1.png]

  3. Untuk mengetahui posisi Y (height) gambar Home, klik kemudian drag Measure Tool seperti pada gambar di ba

    [Image: cssSprite2.png]
    Note: Biar gambar bisa berada di posisi tengah, utak-atik sedikit pada bagian background: url(icon.png) no-repeat -73px -78px, yang aslinya y (Height) =82px, karena kebawah jadi berubah -78px. Lihat gambar before dan after di bagian paling bawah.


  4. Lakukan hal yang sama seperti langkah no 3, untuk mengetahui posisi x (width).

[Image: cssSprite3.png]

[Image: cssSprite4.png]

Guampang sangattt bukan...

Kalo pengen tampil beda untuk tampilan tombolnya, agan2 bisa buat sendiri desainnya...ni ane kasih contoh gampangnya.

Tutorial singkat membuat tombol web

Jangan Lupa post saran dan kritik di bawah...
BE a Creative
Site: http://idesae.blogspot.com
Reply
#2
keren sepertinya
aku bego banget bro css Dead
=====================
im back
Reply
#3
abang yg satu ini jago banget maen css Dead
[Image: siggi.gif]
Reply
#4
sama..!! ane juga bego soal CSS...
ane gk punya SISI di design..
PHP Code:
root@xh4x0r / $ ~
Reply
#5
wahh ilmu yg bgus ne mas, ijin copas y lmyn buat ngentengi load site q
just newbie KESASAR
Reply
#6
(01-16-2012, 02:26 AM)blacx_jackass Wrote: wahh ilmu yg bgus ne mas, ijin copas y lmyn buat ngentengi load site q

monggo, Silahkan, dicopas!!
BE a Creative
Site: http://idesae.blogspot.com
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Cara mudah membuat Logo Dengan Photoshop Cs3 Dr.A 14 632 07-10-2013, 07:07 AM
Last Post: Rifqi Azhar Nugraha
  Membuat desain kartu nama dengan Corel Draw X6 skyland_hacker 7 339 02-25-2013, 07:38 PM
Last Post: Qifwhysoserious
Electric_16 [tutor] Efek Sketsa dengan GIMP E1nzte1N 15 421 01-22-2013, 05:54 PM
Last Post: RockSyd
Electric_16 [tutor] Buat 3D Text dengan Photoshop. E1nzte1N 14 623 12-10-2012, 02:55 PM
Last Post: patronum inc
  Tutorial Desain Teks 3D dengan Perspektif Destr0yer 14 426 12-07-2012, 11:17 AM
Last Post: Destr0yer
Electric_16 [tutor] Buat efek kertas lusuh dengan Photoshop. E1nzte1N 16 631 11-28-2012, 06:32 AM
Last Post: kikihacker
  [tutor] Membuat text 3D dengan Corel Daneswara 14 296 07-23-2012, 09:59 PM
Last Post: Daneswara
  Cara Membedakan Foto Asli Dengan Rekayasa heaven_hope 5 239 07-07-2012, 04:57 AM
Last Post: Rifqi Azhar Nugraha
  Pendapat Mu dengan design kaos ku nubito-cyber404 10 228 06-24-2012, 11:03 AM
Last Post: kikihacker
  (Tutor) membuat web dengan flash spas1 17 904 06-21-2012, 11:15 PM
Last Post: 4c3t0n_4c1d

Forum Jump:


Users browsing this thread: 1 Guest(s)