Forums

[resolved] Automatically Resize Video (7 posts)

  1. fatalx
    Member
    Posted 3 months ago #

    Hey,

    I want videos from posts that have them, to be automatically resized when they are in the sidebar or the homepage, and then full size when they are looked at in the post.

    I have seen this done on other sites. How can this be done?

    Thanks

  2. fatalx
    Member
    Posted 3 months ago #

    anyone?..............

  3. esmi
    Member
    Posted 3 months ago #

    You could try using CSS percentage width and height and specify them differently depending whether a video is in a post or in the sidebar. However, for this to work, you'd need to avoid adding any width or height attributes to the embed markup. Plus, the resolution might be poor when the video is resized via the browser.

  4. fatalx
    Member
    Posted 3 months ago #

    how would I have the CSS apply to only the video and not the entire excerpt?

  5. esmi
    Member
    Posted 3 months ago #

    I assume you're using either the embed or object element to actually embed the video. Yes? So you could use something like:

    .post embed {
    width:75%;
    height:75%;
    }

    I have to admit that I've not tried this myself but it might be worth a shot.

  6. fatalx
    Member
    Posted 3 months ago #

    hey,

    that code didn't work but you lead me along the right path. This code did the trick

    .post object{
    width: 75%;
    height: 75%;
    }

    It does exactly what I need, and its amazingly simple, I didn't know that CSS could effect object attributes.

    Thanks esmi you helped me out alot.

  7. wp_ntnguy
    Member
    Posted 1 month ago #

    I tried .post embed and that worked in Internet Explorer but does not work in Safari and Google Chrome.

    You need to have both .post embed and .post object with the exact same attributes in order for it to work on all browsers as far as I have tested.

Reply

You must log in to post.

About this Topic