Skip to content
  • Unlock Pro
  • Log in with GitHub
Profile
OverviewSolutions
5
Comments
1
Victor Jacon
@Victor-Jacon

All comments

  • Chetan Hatnapure•20
    @CHchetanH
    Submitted almost 4 years ago

    HTML and CSS

    1
    Victor Jacon•75
    @Victor-Jacon
    Posted almost 4 years ago

    Hey there!

    To stretch you need to use flexbox, and use the "align-items: stretch"

    In order to work you need to put that "align-items: stretch" in the parent div, for example:

    <div class"stretch> <div> The content you want to stretch </div> <div>

    Using flexbox you can only define one kind of alignment per "container". If your design needs a more complex alignment, you will need to use css grid.

    Also: By default, the flexbox css components will always occupy all the space available on screen. To "play" with this functionality, use ON THE FLEX ITEM: flex-basis: 0; and flex-grow: 0;

    For example:

    <div class"stretch> <a class="flex-item"> The content you want to play with the sizes </a> <a class="flex-item"> The content you want to play with the sizes </a> <div>

    .flex-item { flex-basis: 0; flex-grow: 0; }

    Here's some code I made to help people understand this concept, copy this github repository, and run on your pc: https://github.com/Victor-Jacon/css-general-practice/tree/main/css-flebox

    Hope it helps <3

    Marked as helpful
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub