'how can i get row and parent width from bootstrap and aurelia app

Howto get bootstrap grid row or grid container width in pixels by aurelia.

I tried to find this on the bootstrap website but I'm still confused because there are several dimensions for width: col-xs, colmd... but in fact, we are just using 4 dimensions: col-3, col-6, col-9, col-12, and nothing more, so basically I need to get that full width in order to translate pixels to col-x again to match resizing from an HTML element.



Solution 1:[1]

To get the width of the grid or row, or any element really, in pixels, you can do the following:

const pixels = document.querySelector('.grid').clientWidth;

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tareq Imbasher