Enis Baydemir
Sayfalar
Anasayfa
HTML Radyonu Yap
Hakkimda
Radyo URL Adresleri
Radyo Dinle
Kitaplar
İletişim
play/stop
Buton Kodlari
KODLAR
Buton Ayarları
İlk olarak bir HTML dosyası oluşturuyorum ve kodlarımı yazmaya başlıyorum.
<html> <head> ... </head> <body> ... </body> </html>
şeklinde bir ana şablon oluşturuyorum.
Body kısmına gidiyorum ve buton oluşturuyorum. Normalde buton oluşturmak için aşağıdaki kodu kullanıyorduk ve resimdeki gibi bir görüntü elde ediyorduk.
<input type="button" value="Yazı" />
Şimdi ben butonuma class parametresi ekliyorum
<input type="button" class="btn" value="Yazı" />
Head kısmına gidiyorum ve css kodlarımı yazıyorum. İlk olarak arkaplanını değiştiriyorum.
<style> .btn { background:#7ef859; } </style>
Butonun kenarlarını düzenliyorum.
<head> <style> .btn { background:#7ef859; border:1px solid #26800b; } </style> </head> <body> <input type="button" class="btn" value="Yazı" /> </body>
Şimdi butonumun yazı tipini, boyutunu ve rengini değiştiriyorum.
color:#001f84; -> font rengi font-weight:bold; -> kalınlık font-family:Verdana; -> yazı tipi font-size:14px; -> büyüklük
Son olarak butonumun boyutunu ayarlıyorum.
width:100px; -> genişlik height:50px; -> yükseklik
Kodun Son Hali
<head> <style> .btn { background:#7ef859; border:1px solid #26800b; color:#001f84; font-weight:bold; font-family:Verdana; font-size:14px; width:100px; height:50px;} </style> </head> <body> <input type="button" class="btn" value="Yazı" /> </body>
Kayan Yazılı Buton
Sitemize Hoşgeldiniz
<!--Name: Düğme Üzerinde Kayan Yazı Kodu--> <!-- <a href="http://google.com" > --> <button style="width: 160px;"> <marquee> Sitemize Hoşgeldiniz </marquee> </button> <!-- </a> --> <script src="https://www.koddostu.com/duzelt.js?no=253"></script>
Buton Kodları
Mozilla Anasayfa
Bu Bir Butondur
Bu Bir Butondur
Pencereyi kapatmak için tıklayın
<button onclick="window.location.href='http://www.mozilla.org/'">Mozilla Anasayfa</button>
<button type="button" style="width:100;height:60">Bu Bir Butondur</button>
<button type="submit" style="width:100;height:60;background-color: #FFFF00">Bu Bir Butondur</button>
<form action="http://SAYFANIN URL ADRESİ"> <input type="submit" value="KONU BAŞLIĞI" style="background-color: #FF0000" /> </form>
<button onclick="javascript:self.close();">Pencereyi kapatmak için tıklayın</button>
Tıklayınca Açılan Buton
Gördüğünüz üzere bu şekilde çalışan bir kod.
<div> <input onclick="if(this.parentNode.getElementsByTagName('div')[0].style.display != ''){this.parentNode.getElementsByTagName('div')[0].style.display = '';this.value = 'Yazıyı Kapa';}else{this.parentNode.getElementsByTagName('div')[0].style.display = 'none'; this.value = 'Yazıyı Aç';}" type="button" value="Yazıyı Aç" /><br /> <div style="display: none;"> Gördüğünüz üzere bu şekilde çalışan bir kod.</div> </div>
Sayfa içini Bölümlere Ayırma
İLGİLİ İÇERİK 1
İLGİLİ İÇERİK 2
İLGİLİ İÇERİK 3
1
2
3
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script><style> .post-pagination { margin: 20px auto; text-align: center; width: 100%; } .button_1, .button_2, .button_3 { border: 2px solid #f4655f; font-weight: 900; padding: 6px 36px; color:#f4655f; transition:ease 0.69s !important; } .button_1:hover, .button_2:hover, .button_3:hover { background: none repeat scroll 0 0 #f4655f; color: #fff; text-decoration: none; } </style> <script type="text/javascript"> jQuery(document).ready(function(){ jQuery('.button_1').click(function(){ jQuery('.content_1').fadeIn('slow'); jQuery('.content_2').fadeOut('fast'); jQuery('.content_3').fadeOut('fast'); jQuery(this).css('background','#F4655F'); jQuery(this).css('color','#fff'); jQuery('.button_2').css('background','#fff'); jQuery('.button_2').css('color','#F4655F'); jQuery('.button_3').css('background','#fff'); jQuery('.button_3').css('color','#F4655F'); return false; }); jQuery('.button_2').click(function(){ jQuery('.content_1').fadeOut('fast'); jQuery('.content_2').fadeIn('slow'); jQuery('.content_3').fadeOut('fast'); jQuery(this).css('background','#F4655F'); jQuery(this).css('color','#fff'); jQuery('.button_1').css('background','#fff'); jQuery('.button_1').css('color','#F4655F'); jQuery('.button_3').css('background','#fff'); jQuery('.button_3').css('color','#F4655F'); return false; }); jQuery('.button_3').click(function(){ jQuery('.content_1').fadeOut('fast'); jQuery('.content_2').fadeOut('fast'); jQuery('.content_3').fadeIn('slow'); jQuery(this).css('background','#F4655F'); jQuery(this).css('color','#fff'); jQuery('.button_1').css('background','#fff'); jQuery('.button_1').css('color','#F4655F'); jQuery('.button_2').css('background','#fff'); jQuery('.button_2').css('color','#F4655F'); return false; }); }); </script> <div class="content_1"> İLGİLİ İÇERİK 1 </div> <div class="content_2" style="display: none;"> İLGİLİ İÇERİK 2 </div> <div class="content_3" style="display: none;"> İLGİLİ İÇERİK 3 </div> <div class="post-pagination"> <a class="button_1" href="#">1</a> <a class="button_2" href="#">2</a> <a class="button_3" href="#">3</a> </div>
Mouse'a Duyarlı Buton
<input type="submit" value="Buraya Tıkla" onmouseover="this.value='http://www.webkenti.net/'" onmouseout="this.value='Buraya Tıkla!'">
Resim Efekti
<a target="_self" href="http://webseyyahi.blogspot.com/"> <img border="0" src="http://cfile23.uf.tistory.com/image/1907AB1B4BF9DD87013250" style="opacity:0.5;filter:alpha(opacity=50)" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onmouseout="this.style.opacity=0.5;this.filters.alpha.opacity=50" /></a>
<a target="_self" href="http://webseyyahi.blogspot.com/"> <img onmouseout="this.style.opacity=1;this.filters.alpha.opacity=100" onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=0" style="opacity: 1;" src="http://cfile23.uf.tistory.com/image/1907AB1B4BF9DD87013250" /></a>
Sallanan Buton
Yavaş sallanan
Hızlı sallanan
<script language="JavaScript"> pos = 15; TO = null; function shake_funct2(object,speed) { obj = eval(object) txt = clear_space(obj.value); if (pos == 15) { txt = txt + " "; pos = -15; } else { txt = " " + txt; pos = 15; } obj.value = txt; obj.style.width = parseInt(obj.style.width) + pos; obj = object sp = speed TO = setTimeout("shake_funct2(obj,sp)",speed); } function clear_space(text) { while (text.substring(0,1) == " ") { text = text.substring(1,text.length); } while(text.substring(text.length-1,text.length) == " ") { text = text.substring(0,text.length-1); } return text; } function end_shake_funct2(object) { clearTimeout(TO); obj = eval(object); txt = clear_space(obj.value); obj.value = txt; //alert(pos); if (pos == -15) { obj.style.width = parseInt(obj.style.width) +15; } pos = 15 } </script> <form name=myform2> <table border=0> <tr><td> Yavaş sallanan </td> <td align=center width=160> <input type=button value = "WEBSEYYAHI" style="font-size:10;width:150" onmouseover="shake_funct2(this,100)" onmouseout="end_shake_funct2(this)"> </td></tr> <tr><td> Hızlı sallanan </td> <td align=center width=160> <input type=button value = "WEBSEYYAHI" style="font-size:10;width:150" onmouseover="shake_funct2(this,50)" onmouseout="end_shake_funct2(this)"> </td></tr> </table>
Resim Animasyonlu Buton
<a href="#"><img hspace="0" border="0" onmouseout="this.src='RESİM 1 URL';" onmouseover="this.src='RESİM 2 URL';" alt="" src="RESİM 1 URL" /></a>
Butona Resim Eklemek
Tkıla oku buton
<button ><img src="http://www.sitekodlari.com/img/ari.png"></button> Tkıla oku buton
Üzerine Gelince Dönen Resim
href="Yönlendirilecek URL" : Tıklandığında gidilmesini istenen site adresi.
src="Resim URL" : Resim adresi.
width="Genişlik değeri girin" height="Yükseklik değeri girin" : Resim boyutları px yada % olabilir.
<style type="text/css"> p#socialicons img{ /* 1st set of icons. Rotate them 360deg onmouseover and out */-moz-transition: all 0.8s ease-in-out;-webkit-transition: all 0.8s ease-in-out;-o-transition: all 0.8s ease-in-out;-ms-transition: all 0.8s ease-in-out;transition: all 0.8s ease-in-out;}p#socialicons img:hover{-moz-transform: rotate(360deg);-webkit-transform: rotate(360deg);-o-transform: rotate(360deg);-ms-transform: rotate(360deg);transform: rotate(360deg);}p#socialicons2 img{ /* 2nd set of icons. Rotate them 60deg onmouseover and out */-moz-transition: all 0.2s ease-in-out;-webkit-transition: all 0.2s ease-in-out;-o-transition: all 0.2s ease-in-out;-ms-transition: all 0.2s ease-in-out;transition: all 0.2s ease-in-out;}p#socialicons2 img:hover{-moz-transform: rotate(70deg);-webkit-transform: rotate(70deg);-o-transform: rotate(70deg);-ms-transform: rotate(70deg);transform: rotate(70deg);}p#socialicons3 img{ /* 3rd set of icons. Rotate them -360deg onmouseover ONLY. Note where the "transition prop is added */}p#socialicons3 img:hover{-moz-transition: all 0.5s ease-in-out;-webkit-transition: all 0.5s ease-in-out;-o-transition: all 0.5s ease-in-out;-ms-transition: all 0.5s ease-in-out;transition: all 0.5s ease-in-out;-moz-transform: rotate(-360deg);-webkit-transform: rotate(-360deg);-o-transform: rotate(-360deg);-ms-transform: rotate(-360deg);transform: rotate(-360deg);} </style> <center> <p id="socialicons" style="text-align: left; "> <a href="Yönlendirilecek URL"> <img border="0" src="http://www.sitekodlari.com/img/ari.png" width="Genişlik değeri girin" height="Yükseklik değeri girin" alt="" /></a> </p> </center>
Renkli buton
Buraya Yaz
<style> /* Content */ .modal > div { width: 500px; background: #fff; position: relative; margin: 10% auto; /* Style */ text-decoration: none; text-shadow: none; text-align: center; font-weight: bold; background: #000; color: #fff; border: 3px solid #fff; border-radius: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.5); } /* Open modal */ a.openModal { -moz-box-shadow:inset 0px 1px 0px 0px #caefab; -webkit-box-shadow:inset 0px 1px 0px 0px #caefab; box-shadow:inset 0px 1px 0px 0px #caefab; background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #77d42a), color-stop(1, #5cb811) ); background:-moz-linear-gradient( center top, #77d42a 5%, #5cb811 100% ); background-color:#77d42a; -moz-border-radius:6px; -webkit-border-radius:6px; border-radius:6px; border:1px solid #268a16; display:inline-block; color:#306108; font-family:Verdana; font-size:15px; font-weight:bold; padding:6px 24px; text-decoration:none; text-shadow:1px 1px 0px #aade7c; } a.openModal:hover, a.openModal:focus { background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #5cb811), color-stop(1, #77d42a) ); background:-moz-linear-gradient( center top, #5cb811 5%, #77d42a 100% ); } </style> <a href="LINK BURAYA" class="openModal">Yazı Buraya</a> <aside id="example" class="modal"> </aside>
İleri Geri Butonu
<form> <p> <input TYPE="button" value="Geri" Name="Geri" onClick="history.back()"> <input TYPE="button" value="Ileri" Name="Ileri" onClick="history.forward()"> </p> </form>
CSS Buton Kodu
Buton İsmi Buraya
<!DOCTYPE html> <html> <head> <style> .button { background-color: #4CAF50; /* Green */ border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; -webkit-transition-duration: 0.4s; /* Safari */ transition-duration: 0.4s; width: 200px; } .button2:hover { box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19); } </style> </head> <body> <a href="Kink Buraya"</a> <button class="button button2">Buton İsmi Buraya</button> </body> </html>