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 8898045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:30:34+00:00 2026-06-15T00:30:34+00:00

i am working on a little game with an underlying hexgrid. For this I

  • 0

i am working on a little game with an underlying hexgrid. For this I was recommended to use svg, because overlapping img have issues with correct mouseinteraction. Now I build a simple hexgrid with some polygons and added a little CSS for a hover-effect. But this does not work properly. It triggers not all the time and is very unsteady in the behaviour.
Basically it consists of:

...
<svg id="svggrid" class="grid" xmlns="http://www.w3.org/2000/svg" version="1.1">
  <polygon points="25,43 75,43 100,86 75,129 25,129 0,86" class="tile"></polygon>
  <polygon points="25,129 75,129 100,172 75,215 25,215 0,172" class="tile"></polygon>
  <polygon points="25,215 75,215 100,258 75,301 25,301 0,258" class="tile"></polygon>
  <polygon points="100,0 150,0 175,43 150,86 100,86 75,43" class="tile"></polygon>
  <polygon points="100,86 150,86 175,129 150,172 100,172 75,129" class="tile"></polygon>
  <polygon points="100,172 150,172 175,215 150,258 100,258 75,215" class="tile"></polygon>
  <polygon points="175,43 225,43 250,86 225,129 175,129 150,86" class="tile"></polygon>
  <polygon points="175,129 225,129 250,172 225,215 175,215 150,172" class="tile"></polygon>
  <polygon points="175,215 225,215 250,258 225,301 175,301 150,258" class="tile"></polygon>
</svg>
...

And the CSS (extern file, linked into the site):

...
.tile{
  stroke: #000000;
  fill:none;
}

.tile:hover{
  stroke: #808080;
  fill:red;
}
...

I put it into this jsfiddle:

http://jsfiddle.net/TZjDp/

If I remove the .tile in the CSS of the SVG, it works, but without I can’t adjust the colors and borders of the polygons. I am confused why it works without this section.

This is shown in this jsfiddle: http://jsfiddle.net/tf3fu/

What am I doing wrong?

  • 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-15T00:30:35+00:00Added an answer on June 15, 2026 at 12:30 am

    The default for events is to only target where the object is drawn and your objects are unfilled. The pointer-events property can adjust this so that hover works whether or not a fill/stroke is set.

    .tile{
        stroke: #000000;
        fill:none;
        pointer-events: visible;
    }
    
    .tile:hover{
        stroke: #808080;
        fill:red;
        pointer-events: visible;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a little snippet from a little flash game I'm working on: This
I'm working on my first game and I have a little over 20 classes.
I am working on building a little game program like this one for a
I'm working on a little game where users login. After you have logged in,
I'm working on a little game/project and I decide to use AndEngine for it
I'm working on my First 2D Game with XNA and I have a little
I have a little text based game i am working on. The user has
I have been working on a game engine for the last little while and
Hey all, working on a C++ little game, Connect 3. This is just like
I am a student, and I'm working on a little slots game (if the

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.