Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Finding Page height

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #32128
    srinarayanan
    Member

    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)..

    #53766
    jamygolden
    Member
    #53767
    srinarayanan
    Member

    yes this really helpful.. but should use a separate css file for a single div height ?

    #53771
    jamygolden
    Member

    You can use media queries within a single css file. https://css-tricks.com/css-media-queries/

    #53504
    srinarayanan
    Member

    wow..! its awesome.. thanks for inducting me the media queries.. It helped me.. :)

    #53501
    srinarayanan
    Member

    but IE not supporting this, what can i do for this..!? pls help..

    #53478
    soap
    Participant

    just use javascript/jquery, man.


    if (screen.width<=1024) {
    myDiv.height(myHeight);
    }

    i think that would work?

    #52924
    srinarayanan
    Member

    thanks, it worked..

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘CSS’ is closed to new topics and replies.