Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
  <title>Absolute-Relative: Width vs. Left/Right</title>
</head>
<body>
  
  <h2>Using "width" CSS</h2>
  
  <a>
    <h3>Cats and stuff - meow, meow!</h3>
  </a>
  
</body>
</html>
 
a h3 {
  /* left: 0;
  right: 0; */
  
  width: 290px;
  
  color: #fff;
  background: rgba(84,78,255,0.55);
  
  
  position: absolute;
  bottom: 0;
  
  margin: 0;
  padding: 5px;
}
a {
  background-image: url('http://placekitten.com/300/100');
  display: block;
  
  height: 100px;
  width: 300px;
  
  position: relative;
}
Output 300px

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

Dismiss x
public
Bin info
Baumrpro
0viewers