Kijan pou m fè sit mwen an "responsive" pou telefòn?
asked 4 months ago495 viewsht
Sit mwen an bèl sou òdinatè, men sou telefòn tout bagay piti, e fò m zoome. Kisa m bliye?
AI diagnosis
AI-generated. Not an answer — the community below confirms or corrects it. Always verify before relying on it.
1 Answer
1. Tag viewport la (sa se pwoblèm ki pi komen an). Mete l nan <head>:
<meta name="viewport" content="width=device-width, initial-scale=1">
San li, telefòn nan afiche paj la tankou yon ekran òdinatè 980px epi li redwi l.
2. Kòmanse pa telefòn (mobile-first), epi ajoute règ pou ekran ki pi laj:
.kolon { display: grid; gap: 1rem; }
@media (min-width: 768px) {
.kolon { grid-template-columns: 1fr 1fr; }
}
3. Evite lajè fiks (width: 900px). Itilize max-width, %, rem, ak fr.
4. Imaj: img { max-width: 100%; height: auto; }
5. Teste ak DevTools (Ctrl+Shift+M nan Chrome), e sitou sou yon vrè telefòn bon mache. Se sa pifò itilizatè w yo genyen.
Sign in to tell others whether this worked.
Sign in and verify your email to post an answer.