Tutorials

Eine immer größer werdende Tutorialdatenbank.

PHP-Fusion Core

Aktuelle PHP-Fusion Vollversionen und Updates

Addon Downloads

Alle Downloads garantiert Kostenlos

Support 24/7

24 Stunden, 7 Tage die Woche, das ganze Jahr.

CSS3 Navigation
Kategorie: CSS
PHP-Fusion Version: Keine
Schwierigkeitsgrad:
 
Eine schöne und einfach zu realisierende CSS3 navigation, die sich dem jeweiligen ausgabemedium anpasst (responsive)

Faq

HTML-Code

GeSHi: HTML


  1. <nav class="animenu">
  2. <ul>
  3. <li>
  4. <a href="#">Item 1</a>
  5. <ul>
  6. <li><a href="">Sub Item 1</a></li>
  7. <li><a href="">Sub Item 2</a></li>
  8. <li><a href="">Sub Item 3</a></li>
  9. </ul>
  10. </li>
  11. <li>
  12. <a href="#">Item 2</a>
  13. <ul>
  14. <li><a href="">Sub Item 1</a></li>
  15. <li><a href="">Sub Item 2</a></li>
  16. <li><a href="">Sub Item 3</a></li>
  17. </ul>
  18. </li>
  19. <li>
  20. <a href="#">Item 3</a>
  21. <ul>
  22. <li><a href="">Sub Item 1</a></li>
  23. <li><a href="">Sub Item 2</a></li>
  24. <li><a href="">Sub Item 3</a></li>
  25. </ul>
  26. </li>
  27. <li>
  28. <a href="#">Item 4</a>
  29. <ul>
  30. <li><a href="">Sub Item 1</a></li>
  31. <li><a href="">Sub Item 2</a></li>
  32. <li><a href="">Sub Item 3</a></li>
  33. </ul>
  34. </li>
  35. </ul>
  36. </nav>
gewandelt in 0.010 Sekunden, benutzt wurde GeSHi 1.0.8.10



CSS
Code
.animenu > ul:after {
  content: "";
  display: table;
  clear: both;
}

.animenu {
  font: bold 13px Arial, Helvetica;
}
.animenu * {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
.animenu ul {
  margin: 0;
  padding: 0;
  list-style: none;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  -ms-border-radius: 3px;
  -o-border-radius: 3px;
  border-radius: 3px;
}
.animenu li {
  position: relative;
}
.animenu li:hover > ul {
  opacity: 1;
  visibility: visible;
  margin: 0;
}
.animenu li:hover > a {
  color: white;
}
.animenu input[type=checkbox] {
  position: absolute;
  top: -9999px;
  left: -9999px;
}
.animenu label {
  display: none;
  cursor: pointer;
  user-select: none;
}

.animenu > ul {
  border: 1px solid #040404;
  background-color: #111111;
  background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(255, 255, 255, 0.2)), color-stop(100%, rgba(255, 255, 255, 0)));
  background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
  background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
  background-image: -o-linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
  background-image: linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
  -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset;
  -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset;
}
.animenu > ul > li {
  float: left;
  border-right: 1px solid #1e1e1e;
  -webkit-box-shadow: 1px 0 0 #444444;
  -moz-box-shadow: 1px 0 0 #444444;
  box-shadow: 1px 0 0 #444444;
}
.animenu > ul > li > a {
  float: left;
  padding: 1em 3em;
  text-transform: uppercase;
}
.animenu > ul a {
  color: #999999;
  text-decoration: none;
  text-shadow: 0 1px 0 #111111;
}
.animenu > ul ul {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  margin: 2em 0 0 0;
  background-color: #373737;
  background-image: none;
  -webkit-transition-property: margin, opacity;
  -moz-transition-property: margin, opacity;
  -o-transition-property: margin, opacity;
  transition-property: margin, opacity;
  -webkit-transition-duration: .15s;
  -moz-transition-duration: .15s;
  -o-transition-duration: .15s;
  transition-duration: .15s;
  -webkit-transition-timing-function: ease-in-out;
  -moz-transition-timing-function: ease-in-out;
  -o-transition-timing-function: ease-in-out;
  transition-timing-function: ease-in-out;
}
.animenu > ul ul li {
  display: block;
  -webkit-box-shadow: 0 1px 0 #1e1e1e, 0 2px 0 #515151;
  -moz-box-shadow: 0 1px 0 #1e1e1e, 0 2px 0 #515151;
  box-shadow: 0 1px 0 #1e1e1e, 0 2px 0 #515151;
}
.animenu > ul ul li:first-child > a {
  -webkit-border-radius: 3px 3px 0 0;
  -moz-border-radius: 3px 3px 0 0;
  -ms-border-radius: 3px 3px 0 0;
  -o-border-radius: 3px 3px 0 0;
  border-radius: 3px 3px 0 0;
}
.animenu > ul ul li:first-child > a:after {
  content: '';
  position: absolute;
  left: 4em;
  top: -12px;
  border: 6px solid transparent;
  border-bottom-color: inherit;
}
.animenu > ul ul li:last-child {
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;
}
.animenu > ul ul li:last-child > a {
  -webkit-border-radius: 0 0 3px 3px;
  -moz-border-radius: 0 0 3px 3px;
  -ms-border-radius: 0 0 3px 3px;
  -o-border-radius: 0 0 3px 3px;
  border-radius: 0 0 3px 3px;
}
.animenu > ul ul a {
  padding: 1em;
  width: 175px;
  display: block;
  border-color: #373737;
}
.animenu > ul ul a:hover {
  background-color: #0186ba;
  border-color: #0186ba;
}

@media screen and (max-width: 180px) {
  .animenu > ul, .animenu > ul ul {
    visibility: visible;
    opacity: 1;
    display: none;
  }

  .animenu input[type=checkbox]:checked ~ label,
  .animenu input[type=checkbox] ~ label:hover {
    color: white;
  }
  .animenu label {
    border: 1px solid #040404;
    background-color: #111111;
    background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(255, 255, 255, 0.2)), color-stop(100%, rgba(255, 255, 255, 0)));
    background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    background-image: -moz-linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    background-image: -o-linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    background-image: linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset;
    -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset;
    color: #999999;
    text-shadow: 0 1px 0 #111111;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    -ms-border-radius: 3px;
    -o-border-radius: 3px;
    border-radius: 3px;
    text-transform: uppercase;
    position: relative;
    display: block;
    padding: 1em 3em;
  }
  .animenu label:before {
    position: absolute;
    left: 0.5em;
    top: 0.2em;
    content: "\2261";
    font-size: 2em;
  }
  .animenu > ul {
    position: relative;
    border-color: #111111;
    margin: 0.5em 0 !important;
    padding: 0.25em;
    -webkit-box-shadow: none;
    -moz-box-shadow: none;
    box-shadow: none;
    background-color: #111111;
    background-image: none;
  }
  .animenu > ul:after {
    content: '';
    position: absolute;
    left: 2em;
    top: -12px;
    border: 6px solid transparent;
    border-bottom-color: inherit;
  }
  .animenu > ul li {
    display: block;
  }
  .animenu > ul > li {
    float: none;
    border: 0;
    -webkit-box-shadow: none;
    -moz-box-shadow: none;
    box-shadow: none;
    background-color: #111111;
    background-image: none;
  }
  .animenu > ul > li > a {
    float: none;
    display: block;
    padding: 1em;
  }
  .animenu > ul ul {
    position: static;
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
    -ms-border-radius: 0;
    -o-border-radius: 0;
    border-radius: 0;
    background-color: #2b2b2b;
    background-image: none;
    margin: 0;
    -webkit-transition-property: none;
    -moz-transition-property: none;
    -o-transition-property: none;
    transition-property: none;
  }
  .animenu > ul ul li:first-child > a {
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
    -ms-border-radius: 0;
    -o-border-radius: 0;
    border-radius: 0;
  }
  .animenu > ul ul li:first-child > a:after {
    content: none;
  }
  .animenu > ul ul li:last-child > a {
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
    -ms-border-radius: 0;
    -o-border-radius: 0;
    border-radius: 0;
  }
  .animenu > ul ul a {
    padding-left: 2em;
    display: block;
    width: auto;
  }
  .animenu input[type=checkbox]:checked ~ ul {
    display: block;
  }
  .animenu input[type=checkbox]:checked ~ ul ul {
    display: block;
  }
}
@-webkit-keyframes bugfix {
  from {
    padding: 0;
  }

  to {
    padding: 0;
  }
}


Demo ansehen

Demo


Tutorial Verlinken

URL: 
BBCode: 
HTML-Code: 
Kommentare
Es wurden noch keine Kommentare verfasst.
Kommentar schreiben
Bitte logge dich ein, um einen Kommentar zu verfassen.
Anzeige


© 2016 Real Space. All rights reserved | Design by W3layouts
Powered by PHP-Fusion copyright © 2002 - 2017 by Nick Jones. Released as free software without warranties under GNU Affero GPL v3.