Title: Hardcoding div height 100% in PHP code .. ?
Last modified: February 14, 2017

---

# Hardcoding div height 100% in PHP code .. ?

 *  [misscosmicdotcom](https://wordpress.org/support/users/misscosmicdotcom/)
 * (@misscosmicdotcom)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/hardcoding-div-height-100-in-php-code/)
 * _[ Moderator note: [moved to Fixing WordPress](https://wordpress.org/support/topic/before-posting-in-everything-wordpress/?view=all).]_
 * I have spend hours on trying to get the main div on height 100%.
 * Tons of different CSS way on different DIVs I have tried without any result, 
   the -main- still stays as high as the content in it..
 * As I want the main to run over the whole height of the screen on the intier site..
   is there a way to achieve this in the PHP .. ?
 * Thanks for helping out
    kind regards from France
    -  This topic was modified 9 years, 3 months ago by [misscosmicdotcom](https://wordpress.org/support/users/misscosmicdotcom/).
    -  This topic was modified 9 years, 3 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).

Viewing 1 replies (of 1 total)

 *  [Patrick](https://wordpress.org/support/users/wppatrickk/)
 * (@wppatrickk)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/hardcoding-div-height-100-in-php-code/#post-8802800)
 * To get the main div to be 100%, the parent must also be 100% and in addition 
   to that, the body and html css should also be height: 100%;
 * Additionally you can also use `height: 100vh`
 * Browser support for viewport units
    [http://caniuse.com/#feat=viewport-units](http://caniuse.com/#feat=viewport-units)

Viewing 1 replies (of 1 total)

The topic ‘Hardcoding div height 100% in PHP code .. ?’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [misscosmicdotcom](https://wordpress.org/support/users/misscosmicdotcom/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/hardcoding-div-height-100-in-php-code/#post-8802800)
 * Status: not a support question

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
