What are the largest valid px
values that CSS width
and height
properties accept?
(I'm currently building a webapp that creates a very large zoomable container element and I want to know what are the actual limits.)
The CSS height and width properties are used to set the height and width of an element. The CSS max-width property is used to set the maximum width of an element. This element has a height of 50 pixels and a width of 100%.
Definition and Usage. The max-width property defines the maximum width of an element. If the content is larger than the maximum width, it will automatically change the height of the element. If the content is smaller than the maximum width, the max-width property has no effect.
The max-height property in CSS is used to set the maximum height of a specified element. Authors may use any of the length values as long as they are a positive value. max-height overrides height, but min-height always overrides max-height .
The term CSS pixel is synonymous with the CSS unit of absolute length px — which is normatively defined as being exactly 1/96th of 1 inch.
Using the CSS inspector that comes with certain browsers on an element with 10000000000px width and height:
Firefox: 33554400px Chrome: 33554428px Opera: 33554428px IE 9: 21474836.47px
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With