Starlit Daily

📚 › HTML: build the structure of a web page

13. Generic boxes: div and span

ستتم ترجمة هذا المقال تلقائيًا. يُعرض بالإنجليزية حاليًا.

div is a block-level box with no meaning of its own. Use it to group content for styling. span is an inline box for a small part of a line.

Use semantic tags first. Reach for div and span only when no meaningful tag fits.

عرض المثال

<div class="card">
  <p>Price: <span class="price">80 BDT</span></p>
</div>

✍️ دورك الآن

Make a div with class card containing a span with class price that says 100.

← العودة إلى الدورة