Html ve Css İle Yatay Animasyonlu Menü-11 - Bilişim Konuları

Html ve Css İle Yatay Animasyonlu Menü-11

Bu örneğimizde fare ile üzerine geldiğimizde renk değiştiren yatay bir menü örneği yapacağız. Renk değiştirme işlemi animasyonlu bir şekilde meydana gelmektedir. Menünün css ve html kodları aşağıdaki gibidir. İstenirse kodlar üzerinde değişiklik yapılarak kendi istediğiniz menüyü oluşturabilirsiniz. Menü dosyasının çalışır hali sayfa altındaki indirme linkinde mevcuttur.

Css Kodları:

<style type="text/css">
/* This first section is a simple "reset". It allows the navbar to push up against the top of the browser window with no white space around it. This code also sets the default font for your whole page. Put it at the very top of your css page.  */
html, body, div, p, ul, li {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
  font-family: 'Roboto', sans-serif;
  font-weight: 100;
}

/* This class is applied to the containing div <div class="nav"> and is used to set the background color and height of the navbar */
.nav {
  background: #000;
  height: 60px; /* set same as height & line-height below */
}

/* This rule centers the nav items verticaly in the bar with the height and line height properties. Spacing between the nav items is controlled by setting right and left padding.  */
.nav li {
  display: inline-block;
  list-style: none;
  height: 60px; /* should be the same as line-height */
  line-height: 60px; /* should be the same as height */
  padding: 0 40px; /* "0" sets top and bottom padding to none */
}

/* :hover allows you change the background color of the nav items when you mouse over them. Play around with the transition value to change the speed of the hover transition. */
.nav li:hover {
  background: red;
  transition: background .3s;
}

/* This rule is applied to the link <a> tag. It lets you turn off the link underline and set the link text color. */
.nav-link {
  color: #fff;
  text-decoration: none;
}
</style>

Html kodları:

<body>
<div class="nav">
  <ul>
    <li><a href="#" class="nav-link">Anasayfa</a></li>
    <li><a href="#" class="nav-link"><em>Dosyalar</em></a></li>
    <li><a href="#" class="nav-link">Urunler</a></li>
    <li><a href="#" class="nav-link">İletişim</a></li>
  </ul>
</div>
</body>

Buradan İndirebilirsiniz.

Bu Yazıya Tepkin Nedir?
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0

Yorum Yap