< /p>
Code: Select all
.container {
background-color: #ddd;
padding: 10px;
max-width: 500px;
margin-left: auto;
margin-right: auto;
}
.button {
display: block;
background-color: #bbb;
margin: 10px;
padding: 10px
}< /code>
Fills the full width
Does not fill the full width
Hinzufügen von Anzeige: Block to .button funktioniert nicht (obwohl ich sicher bin, dass dies an der Antwort teilnehmen muss), und nicht links: 0; Rechts: 0 . Breite: 100% Art von funktioniert, ignoriert jedoch die Padding -Eigenschaft des Containers und lässt die Taste zu nahe an der rechten Seite des Containers gehen.>