Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Simple component HTML/CSS

mark_pherz 450

@mark-pherz

Desktop design screenshot for the Order summary component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What's up community!

I need your help: I have struggled with two color curved background and couldn't find the answer how to make it. I will be grateful if you help me to figure out how to make that background.

Community feedback

Hassia Issah 50,670

@Hassiai

Posted

Replace <div class="wrapper"> with the main tag to make the content/page accessible. click here for more on web-accessibility and semantic html

Give the alt attribute in the img a value. The value of the alt attribute is the description of the image. For decorative images like icons, there is no need to give it an alt value, for more on alt attribute Click here.

There is no need to style .wrapper. Give the body a background-color of pale-blue, use the colors that were given in the styleguide.md found in the zip folder you downloaded, a background-image with a background-size of contain and a background-repeat of no-repeat.

body{
background-color: hsl(pale-blue);
background-image: url();
background-repeat: no-repeat;
background-size: contain;
}

To center .card on the page using flexbox, add min-height:100vh; display: flex; align-items: center: justify-content: center; to the body

body{
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}

For a responsive content, replace the width in .card with max-width , increase its value for it to be equivalent to the design. max-width: 416px which is 26rem/em

This challenge requires a media query, in the media query you only have to change the background-image of the body. For more on media queries, click here

Use relative units like rem or em as unit for the padding, margin, width values and preferably rem for the font-size values, instead of using px which is an absolute unit. For more on CSS units Click here and here

Hope am helpful.

Well done for completing this challenge. HAPPY CODING

Marked as helpful

1

mark_pherz 450

@mark-pherz

Posted

Dear @Hassiai ! Your reply in extremely helpful! Thank you so much !

0
Ambadi M P 380

@Soaphub

Posted

Hello mark_pherz, great work and keep coding and have fun. I reviewed your code in GitHub. The background is not two-colour curved. It's an image placed on the background colour (--very_pale_blue: #f5f7ff) and the images are in your images folder. There are two images one for the desktop view (pattern-background-desktop.svg) and the other one for the mobile view(pattern-background-mobile.svg). You could follow the following steps in the stylesheet to get it right.

  • Move the bg colour from .wraper to the body tag. So the bg colour will be filled in the background of all elements. Even height: 100% or 100vh to take the size of the window screen.
  • Now you could add an image through .wraper div using background-image: url("the location of desktop image"), add width:100% to cover the width screen and height how much ever you want. The .card div would have displaced.
  • Finally, you could add position: absolute to .card div to make it like a popup card. Then add left: 50%, right: 50% and transform: translate(-50%, -50%) to make it in center of the page.
  • To change image in mobile view, use media queries for responsive websites. Even you can reduce card size or image size in different breakpoints and avoid content overflowing out of the screen. eg: @media (max-width: 991.98px){ .wraper{ background-image: url("the location of desktop image") } }. Check W3School to know more about media querry.

Marked as helpful

0

Please log in to post a comment

Log in with GitHub
Discord logo

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