1.Basic CSS syntax
h1 {
color: red;
font-size: 24px;
}
Carefully curated, high-frequency CSS coding questions used in real frontend and UI/UX developer interviews.
h1 {
color: red;
font-size: 24px;
}
.box {
width: 200px;
height: 100px;
background-color: blue;
}
span {
display: inline;
}
div {
display: block;
}
.container {
display: flex;
justify-content: center;
align-items: center;
}
.box {
width: 200px;
margin: 0 auto;
}
@media (max-width: 768px) {
body {
background: lightgray;
}
}
.box {
padding: 10px;
border: 2px solid black;
margin: 15px;
}
.child {
position: absolute;
top: 10px;
left: 20px;
}
.parent {
position: relative;
}
.modal {
position: absolute;
z-index: 1000;
}
.container {
display: flex;
gap: 10px;
}
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
}
button:hover {
background-color: black;
color: white;
}
.box {
transition: all 0.3s ease;
}
@keyframes fade {
from { opacity: 0; }
to { opacity: 1; }
}
.box {
animation: fade 1s;
}
.hidden {
display: none;
}
.box1 { opacity: 0; }
.box2 { visibility: hidden; }
header {
position: sticky;
top: 0;
}
@font-face {
font-family: MyFont;
src: url('font.woff');
}
p {
text-align: center;
}
body {
background-image: url('bg.jpg');
background-size: cover;
}
:root {
--main-color: blue;
}
.box {
color: var(--main-color);
}
img {
max-width: 100%;
height: auto;
}
.box {
overflow: hidden;
}
button {
cursor: pointer;
}