css - styling figure & figcaption -


i wondering if , how can achieve following in css/html current html/css have :

i want first(red) 1 : http://i.stack.imgur.com/tcnvx.jpg

-i have second(blue)/third(green) working -i img(purple f) span whole width of section, have height (80% of section height). have image fill space in image

-i want img clickable (to open lightbox)

-the figcaption has text, should 20%(this adds 100% total) height of section , centered (probably line-height can manage haha..)

my code far :

<section> <article class="graphic">     <figure>         <img src="img/graphic/final.png" alt="image graphic work">         <figcaption>final logo</figcaption>     </figure> </article>  <article class="web">     <figure>         <img src="img/web/obbycmsmockup.png" alt="image web work">         <figcaption>cms webdesign obbycms</figcaption>     </figure> </article>    <article class="misc">     <figure>         <img src="img/misc/ww4.jpg" alt="image other work">         <figcaption>graphic work whitewizard</figcaption>     </figure> </article> 

i think want achieve. styling figures, images , figcaptions.

*{      box-sizing:border-box;  }  article {      width:200px;      height:200px;      float:left;      margin:10px;      color:#fff;  }  .web {      background:green  }  .misc {      background:blue  }  .graphic figure{      width:100%;      height:100%;      margin:0;      background:#fff;  }  .graphic figcaption{      background:#f00;      color:#fff;      width:100%;      height:20%;      text-align:center;      padding:5px;  }  .graphic img {      width:100%;      height:80%;  }  .web img, .misc img {      background:#fff;      width:100%;      height:40%;  }
<article class="graphic">      <figure>          <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/intel-logo.svg/2000px-intel-logo.svg.png" alt="image graphic work">          <figcaption>final logo</figcaption>      </figure>  </article>  <article class="web">      <figure>          <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/intel-logo.svg/2000px-intel-logo.svg.png" alt="image web work">          <figcaption>cms webdesign obbycms</figcaption>      </figure>  </article>  <article class="misc">      <figure>          <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/intel-logo.svg/2000px-intel-logo.svg.png" alt="image other work">          <figcaption>graphic work whitewizard</figcaption>      </figure>  </article>

if need else, comment. if helps, +1.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -