Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

height: -webkit-calc(100% - 155px); not working in Safari

Tags:

css

safari

can anybody see why this is not working in Safari? On this site http://www.transurban.co.nz/newHomePage the div containing the slider has it's height calculated using height: calc(100% - 155px); It works perfectly for all browsers apart from Safari (Safari specific = height: -webkit-calc(100% - 155px); )

Any assistance/suggestions greatly appreciated.

  CSS
  html, body, #wrapper { height: 100%; }

  #headerHome {height:146px;}
  #center {
    height: 100%;
    width:100%;
    overflow: hidden;
    height: -moz-calc(100% - 155px);  
    height: -webkit-calc(100% - 155px);     
    height: calc(100% - 155px); 
  }
  .sliderBox{
    width:100%;
    height:100%;
  }

   HTML

  <div id="wrapper">
        <div id="headerHome">
            HEADER STUFF 
        </div>
        <div class="redBorder"></div>
        <div id="center">                
            <div class="sliderBox">
               SLIDER STUFF HERE                    
            </div>                
           <div class="centralWrap">
        MAIN CONTENT HERE           
          </div>
       </div>
    </div>
like image 434
Grant Avatar asked Apr 27 '14 11:04

Grant


1 Answers

The -webkit-calc feature of Safari just works (buggy) for version 6 and later. It will never work on Windows (Safari for Windows is outdated and should not be used anymore). https://developer.mozilla.org/en-US/docs/Web/CSS/calc

like image 56
KittMedia Avatar answered Sep 29 '22 20:09

KittMedia