Results 1 to 3 of 3

Thread: Vertically center div with div

  1. #1
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Omaha, NE
    Posts
    625
    Vote Rating
    39
      0  

    Default 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
    625
    Vote Rating
    39
      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
      0  

    Default 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;
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •