1. #1
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Omaha, NE
    Posts
    555
    Vote Rating
    24
    estesbubba will become famous soon enough estesbubba will become famous soon enough

      0  

    Default Vertically center div with div

    Vertically center div with div


    Is there a webkit CSS property to easily vertically center a div within another div? I know with standard CSS there are several ways to do it, none of which seem clean. I have a custom Ext.List where each item can vary in height. I have a custom disclosure icon and want it centered vertically depending on height. What should be trivial is frustrating me.

  2. #2
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Omaha, NE
    Posts
    555
    Vote Rating
    24
    estesbubba will become famous soon enough estesbubba will become famous soon enough

      0  

    Default


    Funny - after hours of trying, making a forum post, my next Google search found the answer. Put this on the parent div:

    display: -webkit-box;
    -webkit-box-orient: horizontal;
    -webkit-box-pack: center;
    -webkit-box-align: center;

  3. #3
    Sencha User
    Join Date
    Jul 2014
    Posts
    1
    Vote Rating
    0
    akshayjkadu is on a distinguished road

      0  

    Default This worked for me.

    This worked for me.


    #Content-innerCt {
    display: -webkit-box;
    -webkit-box-orient: horizontal;
    -webkit-box-pack: center;
    -webkit-box-align: center;
    vertical-align: middle !important;
    }

Thread Participants: 1