ich nicht wirklich nicht, wie meine Frage zu erklären, mein erwartetes Ergebnis von Lesern zu bekommen, aber in soluction ich brauche Idee oder soluction auf, wie meine CSS Ausgabe, wie dieses Bild kodieren unten html Dropdown-MenüWie kann ich diese Ausgabe in meinem Dropdown-Menü erreichen
dies mein versucht Code:
a {
color: #4C9CF1;
text-decoration: none;
font-weight: bold;
}
a:hover {
color: #555;
}
nav {
float: left;
padding: 20px;
}
#menu-icon {
display: hidden;
width: 40px;
height: 40px;
background: #4C8FEC url(menu-icon.png) right;
border: 2px solid #000;
border-radius: 4px 0 4px 4px;
}
a:hover#menu-icon {
background-color: #444;
border-radius: 4px 4px 0 0;
}
ul {
list-style: none;
}
li {
display: inline-block;
float: right;
}
section {
margin: 80px auto 40px;
max-width: 980px;
position: relative;
padding: 20px
}
/*MEDIA QUERY*/
@media only screen and (max-width: 640px) {
header {
position: absolute;
}
#menu-icon {
display: inline-block;
}
nav ul,
nav:active ul {
display: none;
position: absolute;
padding: 2px;
border: 2px solid #000;
center: 20px;
width: 100%;
border-radius: 4px 0 4px 4px;
}
nav li {
text-align: center;
width: 100%;
padding: 2px 0;
margin: 0;
}
nav:hover ul {
display: block;
}
<nav>
<a href="#" id="menu-icon"></a>
<ul>
<li><a href="#" class="current">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Work</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
aber es Ausgabe meines Dropdown-Menü wie diese
was soll ich tue großen Dank für Ihre Zeit und Auswirkungen in meinem soluction
Beginnen Sie mit dem Entfernen von 'Breite: 100%' 'von nav li'. Dann ist es nur eine Lage mit Polsterungen/margin usw. – panther
@panther Uhr Leider kann ich nicht wirklich Ihre Idee kann in Antworten einer Code-Ausgabe Ihrer Idee geben? –
Sorry, ich möchte es jetzt nicht programmieren. Sie müssen beide (Symbol und Menü) in eine Zeile setzen (für beide mit float oder inline-block, ohne Positionierung). Dann müssen Sie 100% Breite für "ul" entfernen. Jetzt müssen Sie 'li' in einer Zeile ausrichten, wieder entfernen Sie 100% Breite. Es ist all die Magie. – panther