Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery css min-height

Simple.. I'm running into a syntax error. $('#container').css('min-height', '360'); doesn't set a rule, but $('#container').css('height', '360'); does.

Help?

like image 864
technopeasant Avatar asked Sep 09 '11 06:09

technopeasant


People also ask

How do I change the minimum height in CSS?

CSS Demo: min-heightThis is a box where you can change the minimum height. If there is more content than the minimum the box will grow to the height needed by the content. The element's height is set to the value of min-height whenever min-height is larger than max-height or height .

What does min height 100% do?

You could consider min-height: 100vh; . This sets the height equal or greater to the size of the screen, vh: vertical height .

What is min height 100vh in CSS?

– What is Min Height 100vh in CSS? Min height 100vh means the element should occupy the web browser viewport height. This is always 100 percent of the web browser's viewport height. If there is more content, the element will stretch more than the viewport's height, which is a code example that will clear things up.

What is min height and Min width in CSS?

If the content is smaller than the minimum height, the minimum height will be applied. If the content is larger than the minimum height, the min-height property has no effect. Note: This prevents the value of the height property from becoming smaller than min-height .


2 Answers

First try:

$('#container').css('min-height', '360px');

Otherwise try

$('#container').attr('style','min-height:360px;other-styles');
like image 121
r.piesnikowski Avatar answered Oct 03 '22 01:10

r.piesnikowski


use

$('#container').css('min-height', '360px');
like image 30
BoTheK Avatar answered Oct 03 '22 03:10

BoTheK