0

this is my CSS code, i do not understand why text-align: center; is not working?

embed, iframe, object, video {
    max-width: 98%;
    min-width: 97%;
    box-shadow: 0 0 20px #fff;
    border: 1px solid #ffffff;
    text-align: center !important;
}
  • 1
    Can you provide the mark up also so that we can reproduce the problem. Here is a link to a guide on how to ask a question to get the best chance of it being solved https://stackoverflow.com/help/mcve – Danny Apr 21 '18 at 11:28

2 Answers2

0

If you wish to center it you can try something like:

embed, iframe, object, video {display: block; width: 97%; margin: 0 auto; }

By the way you should avoid using space when adding !important to a property.

A. Meshu
  • 4,053
  • 2
  • 20
  • 34
  • Thanks this is working perfect. display: block; and margin: 0 auto; have fix all, thanks. –  Apr 21 '18 at 12:09
-1

You should try to embed the objects into a <p> or <a> element. Then:

p {
  margin: 0 auto;
  text-align: center;
}

Good luck!

sipi09
  • 389
  • 4
  • 7