Theme
Primary Color

توزيع النص على أعمدة باستخدام Columns

هنوزع نص طويل على عمودين زي المجلات من غير ما نقسم النص يدويا بين عنصرين

كود ال HTML

<div class="ez-magazine-text" dir="ltr">
  HTML describes the structure of a page. CSS controls its appearance.
  Start with simple layouts and practice spacing and typography.
  Build small projects and review them on different screen sizes.
  Clear content and comfortable reading are important parts of every design.
  Keep experimenting and improve one detail at a time.
</div>

كود ال CSS

.ez-magazine-text {
  column-count: 2;
  column-gap: 32px;
  column-rule: 1px solid #78909c;
  line-height: 1.8;
}

@media (max-width: 600px) {
  .ez-magazine-text {
    column-count: 1;
  }
}

شرح الكود

ال column-count: 2 بتوزع المحتوى على عمودين والمتصفح بيحاول يوازن ارتفاعهم

ال column-gap بتحدد المسافة بين العمودين

ال column-rule بترسم خط في المسافة اللي بينهم من غير ما تزود عرض جديد

النص بيكمل من نهاية العمود الأول لبداية التاني حسب اتجاه الكتابة

على الموبايل رجعنا لعمود واحد علشان عرض السطر ميبقاش ضيق

جرب المثال

شوف نتيجة الكود قدامك

HTML describes the structure of a page. CSS controls its appearance. Start with simple layouts and practice spacing and typography. Build small projects and review them on different screen sizes. Clear content and comfortable reading are important parts of every design. Keep experimenting and improve one detail at a time.