Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

194
Visualizações
Howto get bootstrap grid row or grid container width in pixels by javascript

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

I'm using aurelia for javascript but the code can be in standard js (please no jquery).

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.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

get your element using document.querySelectorAll("your html query")[0].offsetWidth.

this command will return the element width in pixels including padding.

I've made an example in jsFiddle:

https://jsfiddle.net/dgf0okrj/

document.querySelectorAll("your html query")[0].offsetWidth

just open your console and run it.

about 4 years ago · Juan Pablo Isaza Relatório

0

You can update the width and max-width of bootstrap row or container or column in css:

.row{
 max-width: 200px !important;
 width: 200px !important;
}

Alternatively you can also use % to update the width but remember to always update the max-width in your css.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda