martedì 29 Settembre 2020

Download in corso

Softwareone.it

05-01-2019

InfoGrid CSS

Struttura

<div class="info-col">
   <h2>Superman</h2>           
       <a class="image superman" href="#">View Image</a>           
         <dl>
          <dt>Super Power</dt>
           <dd><a href="#">Consectetur</a> </dd>
           <dt>Costume</dt>
           <dd></dd>
           <dt>Morality</dt>
           <dd></dd>
           <dt>Sidekicks</dt>
           <dd></dd>
            <dt>Vehicles</dt>
            <dd></dd>
            <dt>Weaknesses</dt>
            <dd></dd>
          </dl>        
</div>

Stile css

.info-col { float: left; width: 132px; height: 100%; padding: 50px 0 0 0; }
.info-col h2 { text-align: center; font-weight: normal; padding: 25px 0; }
  
.image { height: 100px; text-indent: -9999px; display: block; border-right: 1px solid white; }
  
.batman { background: url(../images/batman.jpg) center center no-repeat; }
.spiderman { background: url(../images/spiderman.jpg) center center no-repeat; }
.aquaman { background: url(../images/aquaman.jpg) center center no-repeat; }
.ironman { background: url(../images/ironman.jpg) center center no-repeat; }
.superman { background: url(../images/superman.jpg) center center no-repeat; }
  
dt { padding: 5px; background: #900; color: white; border-bottom: 
    1px solid white; border-right: 1px solid white; 
    }
dd { position: absolute; left: -9999px; top: -9999px; 
    width: 299px; background: #900; padding: 10px; color: 
    white; border-right: 1px solid white;
     }
  
dt:nth-of-type(1) { background: #b44835; }
dd:nth-of-type(1) { background: #b44835; }
  
dt:nth-of-type(2) { background: #ff7d3e; }
dd:nth-of-type(2) { background: #ff7d3e; }
  
dt:nth-of-type(3) { background: #ffb03b; }
dd:nth-of-type(3) { background: #ffb03b; }
  
dt:nth-of-type(4) { background: #c2a25c; }
dd:nth-of-type(4) { background: #c2a25c; }
  
dt:nth-of-type(5) { background: #4c443c; }
dd:nth-of-type(5) { background: #4c443c; }
  
dt:nth-of-type(6) { background: #656b60; }
dd:nth-of-type(6) { background: #656b60; }
  
.curCol { -moz-box-shadow: 0 0 10px rgba(0,0,0,0.2); 
            -webkit-box-shadow: 0 0 10px rgba(0,0,0,0.2); 
            z-index: 1; position: relative; 
            }

Il tutto richiede l’aggiunta di jQuery

<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'></script>

Risultato

Download

https://css-tricks.com/examples/InfoGrid/

Pubblicità

I commenti sono chiusi.

Pubblicità