DEV Community

Discussion on: Responsive hexagon grid without media query

Collapse
 
xnoisebeta profile image
Lenny Dee

Hi. Any ways to use this with percentual values for width/height? If pixels are used (or any other unit), then in some cases there is space left on the right side of the viewport.

Quite brilliant btw, really nice work (i am amazed everytime what can be achieved with css these days).

Thanks in advance.

Collapse
 
afif profile image
Temani Afif

So you want a fixed number of hexagon per row that fit all the width, right?

Collapse
 
xnoisebeta profile image
Lenny Dee

Yeah, that would be ideal as that would prevent the case i mentioned above. Unfortunately my css skills are not so good so i couldnt figure it out :)

Thread Thread
 
afif profile image
Temani Afif

In this case, the easiest solution is to replaced px with vw which is the viewport unit that behave as percentage based on the screen size. To use % we need to change the logic, I will probably write another post about it ;)

Thread Thread
 
viereggjfc profile image
VIEREGG Design - JFC

That would be awesome