When I use margin: 10px
with width: 100%
it gives me the button more bigger that the screen, and the only solution is removing the margin but I need it. This is a simple demo to demonstrate my problem. This is breaking my look and feel of my app.
You can see in this link https://www.w3schools.com/code/tryit.asp?filename=G7HZARR1F6M7 what I am trying to do and the weird behavior that I receive.
.button {
background-color: #4CAF50;
/* Green */
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
width: 100%;
}
.without-margin {
margin: 0px;
}
.with-margin {
margin: 10px;
}
<div>
<button class="button without-margin">What I want but adding margin</button>
<button class="button with-margin">What I receive putting some margin</button>
</div>