locked
Div Percentage Problem in IPad RRS feed

  • Question

  • User523415940 posted

    hi guys

    i have a Div, and its percentage is 100%, it runs perfectly fine in all browsers. i have applied following CSS on that:

    .tab {
        height: 45px;
        ;
        z-index: 999;
        width: 100%;
        background-color: #272727;
        border-top-width: 1px;
        border-top-style: solid;
        border-top-color: #FFFFFF;
        border-right-color: #FFFFFF;
        border-bottom-color: #FFFFFF;
        border-left-color: #FFFFFF;
        margin-right: auto;
        margin-left: auto;
    }

    problem is that when i open same page in IPad, then 100% does not work. there is a samll gap (let say 100px) at the end of the div, which looks very odd. if i cahnge width = 1000px instead of 100%, then it shows properly, but i do not want to fix in pixels

    Any ideas about this???

    Sunday, June 24, 2012 8:59 AM

Answers

  • User1943143334 posted

    Hi,

    I tried the below code in iPhone and iPad browsers, and found working fine!

     <meta name="viewport" content="width=device-width" />   
        <style type="text/css">
        .tab 
        {
            height: 45px;
            ;
            z-index: 999;
            width: 100%;
            background-color: #272727;
            border-top-width: 1px;
            border-top-style: solid;
            border-top-color: #FFFFFF;
            border-right-color: #FFFFFF;
            border-bottom-color: #FFFFFF;
            border-left-color: #FFFFFF;
            margin-right: auto;
            margin-left: auto;
        }
        </style>
    
     <div class="tab" >
            Mobile Website!!!
        </div>

    Hope it helps u...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, June 24, 2012 1:31 PM