Skip to content
    SeaCode
    Learning tracksCode ArenaWorkshops & EventsInstructors
    Log inSign up
    { }CSS

    Styling foundations

    • What is CSS?
    • Cascade and specificity
    • Selectors and element states
    • Colours and text

    Boxes and sizing

    • Padding, border and margin
    • Units and flexible sizing
    • Overflow and image fitting

    Layout and responsiveness

    • Flexbox
    • CSS Grid
    • Positioning and stacking
    • Responsive design
    • Container-based responsiveness

    Design values, direction and motion

    • CSS custom properties and functions
    • Logical properties for RTL and LTR
    • CSS transitions and transforms
    • Keyframes and bounded animation
    • Project: a product card
    CSS

    Design values, direction and motion · Lesson 14 of 17

    Logical properties for RTL and LTR

    Use inline and block instead of assuming left and right.

    8 minutes1 games

    Logical properties follow writing direction: inline is the text axis and block the progression of lines. padding-inline and margin-inline act on the appropriate sides; border-inline-start follows dir. This reduces duplicated RTL and LTR rules.

    HTML
    <style>.note{border-inline-start:4px solid teal;padding-inline-start:16px;margin-block:12px;text-align:start}</style>
    <p class="note" dir="ltr">Start on the left</p>
    <p class="note" dir="rtl" lang="ar">البداية من اليمين</p>
    .note { direction: rtl; }

    Change direction and observe border and spacing.

    Important

    Set document direction with HTML dir. This control changes direction only to demonstrate CSS behavior.

    Interview question

    Must every icon be mirrored in RTL?

    Exercise

    Add a 4px teal inline-start border to an RTL paragraph.

    HTML
    <style></style><p class="note" dir="rtl">معلومة</p>

    Learn more from

    • MDN: CSS referencedeveloper.mozilla.org
    • web.dev: logical-propertiesweb.dev

    Played 0 of 1 games

    Sign in to save your progress and earn XP.

    PreviousCSS custom properties and functionsNextCSS transitions and transforms
    SeaCode

    Learn to code for real, online or at our branch in front of Cairo University, Giza.

    Learn

    • All courses
    • Interactive tutorials
    • Interview practice problems
    • Mock interview
    • Learning tracks
    • Code Arena
    • Workshops & Events
    • Knowledge library
    • Team projects

    Your account

    • Log in
    • Sign up
    • Learning plan
    • Certificates
    • Site map

    Contact us

    • WhatsApp
    • 010 9094 1104
    • In front of Cairo University, Giza

    © 2026 SeaCode. All rights reserved.