24 Replies
What have you tried? What isn't working? What does your code look like currently? Please read #How To Ask Good Questions
sorry i havent read that
I figured. That's why I pointed it out to you :p
so i was using percentages but i know it doesnt work because they use viewport ones but if i give width in pixels is may not be responsive at some point
What are you trying to do? What do you mean by "responsive"? What's the goal?
Percentages are always "responsive" as they respond to the parent container's size. Pixels are never responsive as they are the same size
so i was making a bingo website i need a square the black thing suposed to be square
Like Beck said, share your code. Give #How To Ask Good Questions a read, there's tips on how to share your code in a way that makes it possible for people to answer your questions
bruh
what do you mean "bruh"
and the CSS for the bingocard class?
im trying ðŸ˜ðŸ˜
finally
so height: calc(85%-300px); ignore this i forgot to remove
calc
requires spaces around +
and -
Otherwise it sees +2
as a positive unit and -2
as a negative unitoh
any solve for square thing
.bingocard
I'm still not sure at all what you're trying to accomplish. What's the goal? If you want a square you need to set the height and width to be the same. That's gonna be difficult to maintain on mobile views as the screen is pretty narrow. Would a rectangle work? If you want it to be responsive a square is gonna be extremely difficult.
With a square you need to constantly change the font size to keep the aspect ratio and at a certain point the font is too small to read comfortably. With a rectangle you don't have to adjust the font size and just adjust the width of the element and let it grow in height as-needed
so the bingo actually is a game of 2 players In which a bingo board contains 5x5 squares with random 1 to 25 numbers first one to complete the 5 winning postions like a column a diagonal or a row wins
I don't fully understand what you are trying to achieve as your Codepen looks incomplete, at least it doesn't have any squares within the card. I suspect that you may be adding them via JS or simply haven't added them for the purpose of the demo.
That said, with modern CSS if you ever need a square the simplest method is to use
aspect-ratio: 1;
and only set either the width or the height.yes js is used to dynamically add the inner squares
with numbers
I am pretty sure you could get what you want using aspect-ratio, both on the container (which I presume would be a grid) and the number cells themselves.
thanks 😄