body { margin: 0; display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #f0f0f0; overflow: hidden; } .cross { width: 30px; height: 30px; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); } .cross::before, .cross::after { content: ""; position: absolute; background-color: #ffffff; } .cross::before { width: 100%; height: 2px; top: 50%; left: 0; } .cross::after { width: 2px; height: 100%; left: 50%; top: 0; }