-1

what is upper limit for width in html tag ...

i am using canvas where i need to have maximum width for parent to render content dynamically

.layout{
 width: 10000;//is it a valid value for width 
}

Is there any upper limit for width value

tariqews
  • 19
  • 1
  • 6
  • 1
    have you tried `width: 100%;` ? – Johan Pranata Jul 11 '16 at 07:21
  • 2
    I don't think it's valid, you need to specify a unit measure like `px` or `percent`. I think the better solution might be to simply set `width: 100%` – sTx Jul 11 '16 at 07:22
  • You have a complete answer [here](http://stackoverflow.com/a/16637689/4607733). Please check before asking a question. – logi-kal Jul 11 '16 at 07:28
  • yups with 100% canvas does show fully – tariqews Jul 11 '16 at 09:58
  • Note that canvas drawing area has its own limitations : http://stackoverflow.com/questions/6081483/maximum-size-of-a-canvas-element – Kaiido Jul 11 '16 at 12:15
  • A very large canvas (a very large element of any kind) will slow your app. If you're testing the maximum size of a canvas element then the question you should be asking is how to refactor your code to use a reasonably sized canvas. ;-) – markE Jul 11 '16 at 17:19

2 Answers2

1

I guess it depends on browser. Just give it a very big value and then inspect in dev-tools. My chrome gives 37282700 pixels for an element with style="width: 999999999999999999999px;"

1

Use this in your CSS

tagName{
    width: 100%;
}

this property always set your width of selected tag to maximum-width, works on all screen sizes

Umer Farooq
  • 583
  • 3
  • 17