101.school
CoursesAbout
Search...⌘K
Generate a course with AI...

    Introduction to HTML

    Receive aemail containing the next unit.
    • Introduction to Web Development and HTML Basics
      • 1.1Understanding Web Development
      • 1.2Overview of HTML
      • 1.3Basic HTML Syntax and Tags
      • 1.4HTML Elements
    • HTML Advanced Level
      • 2.1Lists, Tables, and Forms in HTML
      • 2.2HTML5 Elements
      • 2.3HTML Semantics
      • 2.4HTML Validation
    • Introduction to CSS
      • 3.1Understanding the CSS Syntax
      • 3.2CSS Selectors, Properties, and Values
      • 3.3CSS Box Model and Layout
    • CSS Advanced Level
      • 4.1CSS Positioning and Display
      • 4.2CSS Animations and Transforms
      • 4.3Responsive Design with CSS

    CSS Advanced Level

    CSS Positioning and Display

    web design concept

    Web design concept.

    In this unit, we will delve into the concepts of CSS positioning and display properties. These are fundamental aspects of CSS that control the layout and appearance of elements on a webpage.

    CSS Positioning

    CSS positioning properties allow you to control the position of an element. There are five different positioning schemes:

    1. Static: This is the default value. Elements are positioned according to the normal flow of the document.

    2. Relative: The element is positioned relative to its normal position. Offsetting an element (top, right, bottom, left) does not affect the position of other elements.

    3. Absolute: The element is positioned relative to the nearest positioned ancestor. If no such ancestor exists, it's positioned relative to the initial containing block.

    4. Fixed: The element is positioned relative to the browser window. It does not move even if the page is scrolled.

    5. Sticky: The element is positioned based on the user's scroll position. It behaves like a relative positioning until a certain scroll position is met, then it behaves like a fixed positioning.

    CSS Display

    The CSS display property specifies the display behavior of an element. It determines how an element should be displayed on the webpage. There are several display properties:

    1. None: The element will not be displayed at all.

    2. Inline: Elements are displayed in-line with the text. They do not start on a new line and only take up as much width as necessary.

    3. Block: Elements are displayed as block-level elements. They start on a new line and take up the full width available.

    4. Inline-block: Elements are displayed inline, like inline elements, but they can have width and height like block elements.

    5. Flex: The element behaves like a block element and its children behave like flexible box layout elements.

    Understanding and effectively using these positioning and display properties are crucial in controlling the layout of elements on a webpage. By the end of this unit, you should be able to manipulate the position and display of elements to create the desired layout for your webpage.

    Test me
    Practical exercise
    Further reading

    Buenos dias, any questions for me?

    Sign in to chat
    Next up: CSS Animations and Transforms