0

I'm new to CSS and HTML and I was wondering if there is a way I can use the same css but have a different image inside each of the hexagons in this. I'd like to use multiple images in place of 'http://placekitten.com/240/240' without copying/writing too much code over and over.

Check out the fiddle below to see what I mean:

<div class="pfhex1">
    <div class="hexagon hexagon2">
    <div class="hexagon-in1"><div class="hexagon-in2"></div>
    </div></div>

        <div class="pfhex2">
    <div class="hexagon hexagon2">
    <div class="hexagon-in1"><div class="hexagon-in2"></div>
    </div></div>

http://jsfiddle.net/1v57w6xh/

Thanks so much.

web-tiki
  • 99,765
  • 32
  • 217
  • 249

1 Answers1

0

You could either create a new class that has a different background image and apply that to the div you want to change, or create a new rule using your existing selectors, and apply the different background image to that, like:

.pfhex2 .hexagon.hexagon2 .hexagon-in1 .hexagon-in2 {
/* different image */
}
j08691
  • 204,283
  • 31
  • 260
  • 272