Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted almost 3 years ago

four-card-feature-section-master

dvbenthem•110
@dvbenthem
A solution to the Four card feature section challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Hello coders,

This was a fun project to build. The only thing I came across was that when I
give the body a height: 100vh;, the text from the h1 and p from the top text it shifted to the top and out of sight. Does anyone know why this happens?

How do you get that nice border effect without the curling edges on the cards?

Any feedback is welcome :)

Thanks, Danny

Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • David•7,960
    @DavidMorgade
    Posted almost 3 years ago

    Hello Dvbenthem! congrats on finishing the challenge, you did a great job with the layout and your site seems to have good responsiveness

    I will try to answer your questions as far as I can.

    • This is some behaviour that I don't know why it happens, it happened to me in the past and did a research but couldn't get the exact problem, some people usually say is some default styles fault from the browser even after resetting them, you can fix it tho, using min-height: 100vh instead.

    • You have various options, from creating pseudoelements (hardest one in my opinion) to just wrap your <div> with curling edges with other <div> where you use your border, something like this:

    <div class="border" style="box-shadow: 0 -5px 0 0 red;"> <--- this boxshadow will give a border-top
       <div class="card-item supervisor">
           <h2 class="title">Supervisor</h2>
          <p class="text">Monitors activity to identify project roadblocks</p>
          <img src="images/icon-supervisor.svg" alt="">
       </div>
    </div>
    

    With this your border will have no corners since is the border from the parent div, and not the one with the border-radius property!

    Hope my feedback helps you!, if you have any questions, don't hesitate to ask! good job

    Marked as helpful
  • Snehamoy Bag•600
    @snehamoybag
    Posted almost 3 years ago

    Hi @dvbenthem, Congratulations on completing the challenge! Good Job! 👏

    Answering to your query

    Setting a fixed height can be problematic.

    In small screen devices the content's height increases as the content's width shrinks, so if you have a element with set height the content inside of it overflows out of it.

    In your case as you have set a height on body, the extra content overflows out of the body and everything overflowing out of the body gets cropped. 😅

    To fix the issue

    Try to stick with min-height when setting a height on a element. Setting a min-height will give the element the minimum desired height and it'll strech if the content inside of it increases, so it won't cause any overflow.

    In short always use min-height unless you have a solid reason not to. 👍

    Marked as helpful

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord
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

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

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