Ich habe ein Problem mit Element. Ich möchte es display: block
Element machen. Das Problem ist, dass es nicht width
und height
von <li>
Element erben.Anzeigeblock von <a> Element
Antwort
Versuchen Sie folgendes:
* {
\t box-sizing: border-box;
}
html{
\t min-height: 100%;
}
body{
\t width: 100%;
\t background-color: #D8DBE2;
\t color: #D8DBE2;
}
body, .navigation * {
\t margin: 0px;
\t padding: 0px;
}
.navigation{
\t width: 100%;
\t min-height: 70px;
\t margin: 0px;
\t padding: 0px;
\t background-color: #181E1D;
}
.naviagation__list{
\t display: flex;
\t flex-flow: row wrap;
\t justify-content: center;
\t float: right;
\t width: 55%;
\t min-height: 70px;
}
.navigation__item{
\t display: flex;
\t justify-content: center;
\t align-items: center;
\t border: 1px solid white;
\t width: 25%;
\t min-height: 70px;
\t list-style-type: none;
text-align: center;
}
.navigation__link{
\t display: inline-block;
\t text-decoration: none;
\t color: inherit;
width: 100%;
height: 100%;
line-height: 70px;
}
<nav class="navigation">
<ul class="naviagation__list">
<li class="navigation__item">
<a href="#" class="navigation__link"> Main page </a>
</li>
<li class="navigation__item">
<a href="#" class="navigation__link"> About us </a>
</li>
<li class="navigation__item">
<a href="#" class="navigation__link"> Products </a>
</li>
<li class="navigation__item">
<a href="#" class="navigation__link"> Contact </a>
</li>
</ul>
</nav>
Danke! Es hilft mir :) – qwerty1234567
@zgrybus: Wenn diese oder irgendeine Antwort Ihre Frage gelöst hat, ziehen Sie bitte in Betracht, sie zu akzeptieren, indem Sie das Häkchen klicken. Dies zeigt der breiteren Gemeinschaft, dass Sie eine Lösung gefunden haben und sowohl dem Antworter als auch Ihnen einen guten Ruf verschaffen. Es besteht keine Verpflichtung, dies zu tun. – Fralec
.. Fertig :) .......... – qwerty1234567
Sie verwenden sollten: width: 100%
und height: 100%
für <a>
* {
\t box-sizing: border-box;
}
html{
\t min-height: 100%;
}
body{
\t width: 100%;
\t background-color: #D8DBE2;
\t color: #D8DBE2;
}
body, .navigation * {
\t margin: 0px;
\t padding: 0px;
}
.navigation{
\t width: 100%;
\t min-height: 70px;
\t margin: 0px;
\t padding: 0px;
\t background-color: #181E1D;
}
.naviagation__list{
\t display: flex;
\t flex-flow: row wrap;
\t justify-content: center;
\t float: right;
\t width: 55%;
\t min-height: 70px;
}
.navigation__item{
\t display: flex;
\t justify-content: center;
\t align-items: center;
\t border: 1px solid white;
\t width: 25%;
\t min-height: 70px;
\t list-style-type: none;
}
.navigation__link{
\t display: block;
\t text-decoration: none;
\t color: inherit;
width: 100%;
height: 100%;
padding-top: 22px
}
<nav class="navigation">
<ul class="naviagation__list">
<li class="navigation__item">
<a href="#" class="navigation__link"> Main page </a>
</li>
<li class="navigation__item">
<a href="#" class="navigation__link"> About us </a>
</li>
<li class="navigation__item">
<a href="#" class="navigation__link"> Products </a>
</li>
<li class="navigation__item">
<a href="#" class="navigation__link"> Contact </a>
</li>
</ul>
</nav>
- 1. JQuery Anzeigeblock nach Teilseitenlade
- 2. CSS Zentrieren, wenn Anzeigeblock
- 3. Anzeigeblock Probleme in den folgenden
- 4. XSLT: Drehen <element></element> in <element />
- 5. Warum wird mein Anzeigeblock nicht wieder angezeigt?
- 6. XSD Formatierung <element><complexType> vs <complex /><element/>
- 7. Prevent Textauswahl von <button> Element
- 8. entfernen <br> von Element wird
- 9. QXmlStreamReader lesen <element><value/></element>
- 10. <input> Element mit <title> Tag Inhalt
- 11. Warum ein <svg> Element in ein anderes <svg> Element verschachteln?
- 12. Der Anzeigeblock und keiner ändert die Tabelle Einrückung
- 13. Schränkungsweite für <a element in <td to 100%
- 14. $ Injektor: UNPR :: Unbekannter Anbieter: $ elementProvider <- $ Element <- DragulardndCtrl
- 15. Was ist <span></span> Element?
- 16. wie auszuwählen Elternteil <script> Element
- 17. bewegen Element nach bestimmten Element + zwei `<br>`
- 18. Zufälliges Element der Liste <T> von LINQ SQL
- 19. Javascript Senden von Tastencodes zu einem <textarea> Element
- 20. Verwenden von float und löschen mit <aside> element
- 21. Verwenden von Nhibernate <loader> Element mit HQL-Abfragen
- 22. Ändern von Stil auf <body> Element
- 23. Was ist <client> Element von app.config?
- 24. Erstellen von Heatmaps mit <canvas> Element?
- 25. Scrapy XPath Text von einem Element erhalten, das mit <
- 26. Getting Text von <td> Element mit jQuery
- 27. Welches Element für die Rückseite von <abbr>
- 28. Inkrement letztes Element von Vec <usize>
- 29. Wie behandelt man <Element id = "someValue"> Hallo Welt</Element> in Jaxb dynamisch?
- 30. Textposition innerhalb <a> Element
Willkommen bei Stack Overflow. Bitte überprüfen Sie dies: [Wie stelle ich eine gute Frage?] (Http://stackoverflow.com/help/how-to-ask) –