Web R
Web R

Reputation: 575

How to make flexbox to support IE10 and Safari?

Right now I have this code:

display: flex;
justify-content: center;
align-items: center;

The element centers on Chrome and Firefox, but not on IE10. I didn't check it yet on Safari and others browsers, but I want it to support them too. What should I add to this code?

Upvotes: 0

Views: 72

Answers (1)

Stickers
Stickers

Reputation: 78776

You will need relevant vendor prefixes for IE10, Safari 8 and below, example:

.my-class-name {

  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;

  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;

  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;

}

Upvotes: 1

Related Questions