Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!doctype html>
<html>
<head>
    <meta charset=utf-8>
    <title>JS Bin</title>
</head>
<!--
Every time you use this aspect ratio method just use this html structure:
<div class="wrapper">
    <div class="four-by-three aspect-ratio"></div>
    <div class="content">
        <h1>Content goes in here.</h1>
    </div>
</div>
-->
<body>
    <div class="wrapper main-box">
        <div class="four-by-three aspect-ratio"></div>
        <div class="content">
            <h1>Howdy!</h1>
            <p>This box has a 4:3 aspect ratio. Its width is 80% of the page width. Its height is three quarters of its width.</p>
            <div class="wrapper half">
                <div class="three-by-two aspect-ratio"></div>
                <div class="content">
                    <h1>3:2</h1>
                    <div>width: 50%</div>
                    <div>height: two thirds of width</div>
                </div>
            </div>
            <div class="wrapper half">
                <div class="sixteen-by-nine aspect-ratio"></div>
                <div class="content">
                    <h1>16:9</h1>
                    <div>width: 50%</div>
                    <div>height: nine sixteenths of width</div>
                </div>
            </div>
            
        </div>
    </div>
</body>
</html>
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers