I have a question about the code snippet below. The <div>
element seems to be smaller than its content. Can anyone explain why this is happening and suggest a solution to fix it?
.switcher {
border: 1px dashed green;
}
.switcher a {
padding: 30px;
background: orange;
}
<div class=switcher>
<a href=#>first</a>
<a href=#>second</a>
</div>