Using width and minimum width

When writing a web page in html, can you use two different quantitative measures for width and min_width?

For example, you can use:

width: 90%
min-width: 600px

Should they both be the same unit (px or%), or does it not matter? I am trying to do this on a webpage but it is not working. I use this for the minimum jqGrid table size, but I would not have thought that it mattered.

+5
source share
3 answers

They can definitely work together. The width declaration will be set to 90% of the container width. The minimum width makes it so that the element has a width of at least 600 pixels.

+5
source

min-width: 600px;. . . . min-width, , width, 90% .

+3

You have not specifically specified how you allow the user to resize the grid. If you use gridResize , you can add additional parameters like

$("#list").jqGrid('gridResize', {minWidth: 450, minHeight: 100});
+2
source

All Articles