html, body { width: 100%; } #tabs { margin-top: 1px; width: 100%; } .tab { display: flex; align-items: center; justify-content: flex-start; border: solid #cfcfcf 1px; margin-bottom: 1px; padding-left: 2px; padding-bottom: 2px; width: 100%; } .tab.active { background-color: #d4f2fc; } .tab:hover { background-color: #cccccc; } .tab.active:hover { background-color: #b2dceb; } .tab-title { display: inline-block; align-self: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; } .tab-favicon { /* necessary to avoid flicker when hovering the close button */ flex-shrink: 0; display: inline-block; background-size: cover; background-position: center; width: 15px; height: 15px; margin-left: 5px; margin-right: 5px; vertical-align: middle; } .close-button-parent { width: 17px; height: 17px; margin-right: 4px; display: none; } .tab:hover > .close-button-parent { display: inline-block; } .close-button-parent:hover { background-color: #707070; } .close-button-outer { height: 15px; width: 2px; margin-left: 6.2px; margin-top: 1.2px; background-color: black; transform: rotate(45deg); Z-index: 1; } .close-button-inner { height: 15px; width: 2px; background-color: black; transform: rotate(90deg); Z-index: 2; } .close-button-parent:hover .close-button-outer { background-color: #cccccc; } .close-button-parent:hover .close-button-inner { background-color: #cccccc; }