Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9163679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:30:12+00:00 2026-06-17T14:30:12+00:00

I found a great stackoverflow answer on how to create a hexagonal patten using

  • 0

I found a great stackoverflow answer on how to create a hexagonal patten using CSS.

Generate repeating hexagonal pattern with CSS3

It’s almost perfect, except i’d like to flip the hexagons the other way (ie. so the point is at the top). I’ve managed to do this fairly easily by swapping the main hex div width/height: (hexrow > div)… however i’m really struggling to re-align the background image on the other supporting divs. I’ve been trying to figure it out for a while now without much success.

Could anyone possibly post a jsFiddle that shows how it’s done?

This is where i’m at currently: What i’ve tried

..and i believe this is what i need to amend:

.hexrow > div > div:first-of-type:before {
    content: '';
    position: absolute;
    width: 200px; /* width of main + margin sizing */
    height: 100%;
    background-image: inherit;
    background-position: 0 0;
    background-repeat: no-repeat;
    background-size: 120% auto;
    bottom: 0;
    left: 0;
    z-index: 1;

    -ms-transform:rotate(-60deg) translate(-150px, 0); /* IE 9 */
    -moz-transform:rotate(-60deg) translate(-150px, 0); /* Firefox */
    -webkit-transform:rotate(-60deg) translate(-150px, 0); /* Safari and Chrome */
    -o-transform:rotate(-60deg) translate(-150px, 0); /* Opera */
    transform:rotate(-60deg) translate(-150px, 0);

    -ms-transform-origin: 0 0; /* IE 9 */
    -webkit-transform-origin: 0 0; /* Safari and Chrome */
    -moz-transform-origin: 0 0; /* Firefox */
    -o-transform-origin: 0 0; /* Opera */
    transform-origin: 0 0;
}

Any help much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:30:14+00:00Added an answer on June 17, 2026 at 2:30 pm

    Use :nth-of-type(odd) and :nth-of-type(even) and set different margins for odd/ even hexagons on the same row.


    Or you could do it in a much simpler manner, with less markup – check my answer at that question and this demo I just did. The idea is that you apply a series of transforms on the element (which has overflow: hidden) in order to get a rhombus with an acute angle of 60 degrees and then you undo all those transforms in reverse order for a pseudo-element or a child element if you wish (having the same height as the element itself, but only .866 of its width, because .866 is the ratio of the distance between two parallel sides of a hexagon and its big diagonal) on which you actually apply the background-image. So there’s no chance of misalignment, because the background image is only applied on one element.

    Basic HTML structure:

    <div class='row'>
        <div class='hexagon'></div>
    </div>
    <div class='row'>
        <div class='hexagon content ribbon' data-content='This is a test!!! 
        9/10'></div><!--
        --><div class='hexagon content longtext' data-content='Some longer text here.
           Bla bla bla bla bla bla bla bla bla bla blaaaah...'></div>
    </div>
    

    Relevant CSS:

    .row { margin: -8% 0%; text-align: center; }
    .row:first-child { margin-top: 2.25%; }
    .hexagon {
        position: relative;
        display: inline-block;
        overflow: hidden;
        margin: 0 -1.5%;
        padding: 16%;
        transform: rotate(-30deg) skewX(30deg) scaleY(.866); /* .866 = sqrt(3)/2 */
    }
    .hexagon:before {
        display: block;
        position: absolute; /* 86.6% = (sqrt(3)/2)*100% = .866*100% */
        right: 6.7%; bottom: 0; left: 6.7%; top: 0; /* 6.7% = (100% -86.6%)/2 */
        transform: scaleY(1.155) skewX(-30deg) rotate(30deg); /* 1.155 = 2/sqrt(3) */
        background-color: rgba(30,144,255,.56);
        background-size: cover;
        content: '';
    }
    .row:first-child .hexagon:first-child:before {
        background-image: url(img.jpg); 
    } 
    /* and so on, add background images for all hexagons */
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found this perfect answer to search through an NSFetchedResultsController : https://stackoverflow.com/a/4481896/1486928 EDIT :
I am using this solution found on stackoverflow to encode my MYSQL output to
I found this great jqueryui buttonset script here on stackoverflow. It was meant for
I found a great tutorial on creating an MVC App from Scratch using Sencha
I am utilizing a class AutoResizeTextView I found here: https://stackoverflow.com/a/5535672/371778 This has worked great
I just joined StackOverflow after having found many great answers here in the past.
I used a javascript resize function i found on stackoverflow and it works great
I found great examples of what Im looking for here : http://hugoduncan.org/post/2010/shell_scripting_in_clojure_with_pallet.xhtml But seems
I found great tool for Image slide show as in the link below http://thiagosf.net/projects/jquery/skitter/
I have problem with text drawing around Circle. I found great sample in C#

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.