I am working on the treeview component for the menu on the left (see screenshot):

All items in the tree view must be selected. I set the width to 100% for the elements, and when I select an element in the width of the tree of the selection, it’s smaller than the left panel:

But the width of the selection will be equal to the width of the left sidebar. I know that this can be achieved by using fields and additions for the selected region, for example:
{
margin: 0 -400px;
padding: 0 400px;
}
But this leads to a horizontal scrollbar:

Are there any “smart” ways to make the selected area stretched to the container (left panel)?
source
share