- This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
Viewing 8 posts - 1 through 8 (of 8 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hii,
I want to give a height to a div. Depends upon the screen height, i want to put it. Not with Percentage..(fixed height, for example, if the screen size is above 1024 res, then this height shuld be some 500px if it is below 1024, the height of the div should be like 300px..) Any conditional statements to define this…? pls suggest.. Im trying to avoid javascript to use.. anyway pls help (with javascript also if no other way)..
Read this article: https://css-tricks.com/resolution-specific-stylesheets/
yes this really helpful.. but should use a separate css file for a single div height ?
You can use media queries within a single css file. https://css-tricks.com/css-media-queries/
wow..! its awesome.. thanks for inducting me the media queries.. It helped me.. :)
but IE not supporting this, what can i do for this..!? pls help..
just use javascript/jquery, man.
if (screen.width<=1024) {
myDiv.height(myHeight);
}
i think that would work?
thanks, it worked..