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>
<body>
  <ul>
    <li>1</li><li>2</li><li>3</li>
  </ul>
  
  
  <ul>
    <li>1</li><li>2</li><li>3</li>
    <li>4</li><li>5</li><li>6</li>
    <li>7</li><li>8</li>
  </ul>
  <ul>
    <li>1</li><li>2</li><li>3</li>
    <li>4</li><li>5</li><li>6</li>
    
  </ul>
  <ul>
    <li>1</li><li>2</li><li>3</li>
    <li>4</li>
  </ul>
  <ul>
    <li>1</li><li>2</li><li>3</li>
    <li>4</li><li>5</li><li>6</li>
    <li>7</li><li>8</li><li>9</li>
    <li>10</li><li>11</li><li>12</li>
    <li>13</li><li>14</li><li>15</li>
  </ul>
  
  
</body>
</html>
 
ul { list-style: none;  
     margin: 3em 0 0 0; padding: 0;
     height: auto; overflow: hidden; 
     position : relative;
}
li { float: left; width: 30px; height: 30px; 
     position: relative; z-index : 1;  
     text-align: center; line-height: 30px;}
li:nth-child(3n+1) { clear: left }
ul:before {
   position: absolute;
   z-index : 1;
   content : "";
   display : block;
   background : #f00;
   left    : 0;
   top     : -30px;
   width   : 100%;
   height  : 100%;
  
   /* note: if you need to have at least  
      ONE rows always highlighted 
      just apply
   
   min-height : 60px; // height of li*2
  
   */
}
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers