Site logo

Archived topic

2 css coding questions, please

5 replies · Started by Ilse Turnbull on May 13, 2017

Viewing posts 1–6 of 6

I installed the Simple CSS plugin.

I would like to have a simple code for centering youtube videos. I'm wondering if this would work?

iframe { display: block;
margin: auto;
}

If I use that and put it in simple css - I won't need any extra html when I embed videos?

Question #2
On W3schools they suggest adding this to keep images from being pulled out of shape in a responsive design - is it necessary?

img { max-width: 100%;
height: auto;
}

Hi there,

1. Yup that should work. I would add another selector in front of it but it should work either way:

.entry-content iframe {
    display: block;
    margin: auto;
}

2. Nope that's not necessary. If you use the img tag then it should be responsive.

Let me know if you need more info :)

Thanks Leo - with the extra bit you put in do I need to add some html to the embed code?

Nope that just targeting all the iframe element inside entry-content :)

Thank you. Really appreciate the help

Glad I could help :)

This archived topic is closed to new replies.