Black Friday Sale! Get up to $40 off GP Premium!Learn more

[Resolved] 2 css coding questions, please

Home Forums Support 2 css coding questions, please

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #317502
    Ilse Turnbull

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

    #317513
    Leo
    Staff
    Customer Support

    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 🙂

    #317530
    Ilse Turnbull

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

    #317532
    Leo
    Staff
    Customer Support

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

    #317585
    Ilse Turnbull

    Thank you. Really appreciate the help

    #317594
    Leo
    Staff
    Customer Support

    Glad I could help 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.