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>
<!--[if IE]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
  article, aside, figure, footer, header, hgroup, 
  menu, nav, section { display: block; }
  #outer
{ 
    float:left;
    width:500px; 
    border: 1px solid red; 
    position:relative;
}
#inner
{
    left:0;
    right:0;
    position:absolute;
    border: 1px solid black;
    background:green;
}
</style>
</head>
<body>
  <div id='outer'>
    <div id='inner'>
        some text inside div
    </div>
</div>
</body>
</html>
 
if (document.getElementById('hello')) {
  document.getElementById('hello').innerHTML = 'Hello World - this was inserted using JavaScript';
}
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers