How to center an iframe horizontally?

I have been trying to center a youtube video horizontally on my landing page, but couldn’t do it.


<section id="#how-it-works">
          <iframe id="video" height="315" src="" frameborder="0" allowfullscreen>


  margin-top: 50px;
  display: flex;
  justify-content: center;

#how-it-works > iframe{
  max-width: 560px;
  width: 100%;

What is the solution?


Are you sure that is how you set an id attribute value?

Edit: Did you understand what the problem is?

1 Like

You are correct.
Didn’t see that coming.


This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.