-1

Hi all this is a simple tic tac toe game board made with css flex .I want to paste "X" in the vertical center of box when its hovered with using flex.This is the link codepen.io/anon/pen/bMOmRq

Temani Afif
  • 245,468
  • 26
  • 309
  • 415

2 Answers2

0

Add this css to .box

  display: flex;
  align-items: center;
  justify-content: center;

https://codepen.io/anon/pen/RyEeYa

Mohamed Ramrami
  • 12,026
  • 4
  • 33
  • 49
0

Use this code for vertical center:

.box:hover::before{
    content: "X";
  display:flex;
  align-items:center;
  height:100%;
  justify-content: center;
}
Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
renuka
  • 698
  • 4
  • 8