Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9083055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:41:39+00:00 2026-06-16T20:41:39+00:00

Here is the issue at a high level: I have a Flash video player

  • 0

Here is the issue at a high level: I have a Flash video player for 16:9 video. The total height of the player is taken up by the video itself plus some controls. The height of the controls is constant regardless of the height of the overall player. So what I want to do is have the player scale with CSS so that the height satisfies the equation:
y = rx + C, where x is the width, r is the ratio of video height to video width, and C is the constant height of the controls.

I’ve worked out something that works in Webkit, but seemingly nothing else:

#video-container {
    height: 0px;
    padding-bottom: 56%; /* proportional scaling */
    position:relative;
    width: 100%;
}
#video-container object {
    height: 100%;
    padding-bottom: 50px; /* control height */
    position: absolute;
    width: 100%;
}

In Webkit, the Flash movie will scale vertically to fill the bottom padding area. In every other browser, though, the bottom padding is just empty space.

Is there a CSS-only solution for scaling the height of an element proportional to the width plus some constant value? There are plenty of questions on SO related to proportional scaling, but the constant part is the tricky part.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T20:41:41+00:00Added an answer on June 16, 2026 at 8:41 pm

    Here is a fiddle that uses slightly different numbers, but is set up to illustrate a “proportional to width plus some constant value” idea for the height. It is based on your original idea, with a tweak. It seemed to test fine in IE8+, Chrome, Firefox.

    Essentially, the code you would need is probably this:

    #video-container {
        position:relative;
        width: 100%;
        height: 0px;
        padding-bottom: 56%; /* proportional scaling */
        padding-top: 50px; /* add constant */
    }
    
    #video-container object {
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ImagesController that kicks off a non-trivial save operation. Here's the high-level
Having an issue here that I have tried everything I can think of but
I have a really weird issue here. I'm using my local development server right
I have a curious issue here In my ejbCreate() method from where i insert
I have been searching high/low on the GooglePlex and here for a sample MVC3
I have a height issue. I'm working with this table. - enter link description
My issue here is quite simple : i'm trying to use the jQuery validate
Im having a weird issue here. Its probably just something stupid but I dont
I am facing a issue here in reading the values set by a stored
I'm having a small issue here: <div id=navbar> <ul id=navtabs class=floatcontainer> <li <?php if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.