CSS 0 dan: Layout, Responsive, Animatsiya

1) CSS nima?

CSS (Cascading Style Sheets) — HTML ko‘rinishini (dizaynini) boshqaradi: rang, font, joylashuv, animatsiya.

2) CSS ulash

<link rel="stylesheet" href="style.css">

3) Selektorlar

/* Element */
p { font-size: 18px; }

/* Class */
.card { padding: 16px; }

/* ID */
#hero { margin-top: 20px; }

/* Nested */
nav a { text-decoration: none; }

/* Pseudo */
a:hover { opacity: .85; }

4) Box Model

.box{
  width: 300px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.2);
  margin: 20px;
}

5) Matn, rang, fon

body{
  background: #050510;
  color: #e7e7f0;
  font-family: "Segoe UI", sans-serif;
}

h1{ font-size: 40px; letter-spacing: .5px; }
.muted{ color: rgba(231,231,240,.7); }

6) Flexbox

.row{
  display:flex;
  gap:14px;
  align-items:center;
  justify-content:space-between;
}

Flex — menyu, kartalar qatorini tez yig‘ish uchun juda qulay.

7) Grid

.grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

8) Responsive (telefon)

@media (max-width: 768px){
  .row{ flex-direction: column; align-items: stretch; }
  h1{ font-size: 30px; }
}

9) Hover, transition, animatsiya

.card{
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover{
  transform: translateY(-4px);
}

10) Mini-loyiha: “Neon Dark UI”

  1. Header + menu (flex)
  2. Grid kartalar (grid)
  3. Hover effekt
  4. Responsive
✅ Maqsad

Hozirgi saytning qora fonli, neon uslubini o‘zing 0 dan yasay oladigan darajaga chiqasan.


📞 Aloqa

Savollar bo‘lsa yozing:

CSS nima?

CSS (Cascading Style Sheets) — web sahifaning ko‘rinishi: rang, o‘lcham, joylashuv, animatsiya.

selector { property: value; }

Selectorlar (eng keraklilari)

h1 { font-size: 32px; }
.card { border-radius: 16px; }
#menu { position: sticky; top: 0; }
button:hover { transform: translateY(-2px); }

Layout: Flex va Grid

Flex

.row{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
}

Grid

.grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap:16px;
}

Mini: “Glass” dizayn

.glass{
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  border-radius: 18px;
}