When I scroll horizontally in a div, the background-color of .filesColumn:focus does not fully display across the width.
If I add overflow-x:auto to .fileColumn, it displays the full width.
How can I ensure that the background-color of the child element is fully visible when I scroll horizontally in the containing div.contentModel?
Please refer to the code snippet here: jsfiddle
html,
body {
height: 100%;
}
body {
padding: 10px;
box-sizing: border-box;
}
.container {
width: 100%;
height: 100%;
padding: 20px 0;
box-sizing: border-box;
border-radius: 7px;
background-color: rgba(16, 40, 136, 1);
}
.contentModal {
width: 100%;
height: 100%;
overflow-x: auto;
overflow-y: auto;
}
.filesColumn {
display: block;
width: 100%;
height: 30px;
line-height: 30px;
padding: 0 20px;
box-sizing: border-box;
font-size: 14px;
text-align: left;
text-decoration: none;
letter-spacing: 1px;
color: rgba(255, 255, 255, 1);
background-color: rgba(16, 40, 136, 1);
}
.filesColumn:hover {
background-color: rgba(48, 88, 184, 1);
}
.filesColumn:active,
.filesColumn:focus {
background-color: rgba(79, 134, 235, 1);
}
<div class="container">
<div class="contentModal">
<a href="#" class="filesColumn">ABCDEFGHIJKLMNOPQRSTUVWXYZ</a>
<a href="#" class="filesColumn">ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ</a>
<a href="#" class="filesColumn">ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ</a>
</div>
</div>