@Hassiai
Posted
There is no need for <div class="bg"> in the html and in its styling in the css.
Replace<div class="card">with the main tag and <div class="attribution"> with the footer tag to fix the accessibility issues. click here for more on web-accessibility and semantic html
Add the alt attribute alt=" "
to the img tag to fix the error issues, the value of the alt tag is the description of the image.
Give the body the background-color you gave to .bg. There is no need to give the root and html a min-height, background-color and min-width values they are not needed. change the margin value in r the root and html to 0 margin:0;
To center .card on the body using flexbox, add min-height: 100vh; display: flx; justify-content: center; align-items: center;
To center .card on the page using flexbox:
body{
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
For a responsive content which wont require a media query for this challenge , replace the width with max-width and give it a fixed value max-width: 320px
. there is no need for the height value replace it padding value for all the sides, this will prevent the content from overflowing.
`padding: 15px'. Give the img a max-width of 100%instead of a fixed max-width and max-height values. Give p a margin-bottom value.
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
Hope am helpful.
Well done for completing this challenge. HAPPY CODING
Marked as helpful
@fa7eh
Posted
@Hassiai Thanks for your response.
I updated the code.
Can you please enlighten me more about responsive content? I do get confused with images and div, how I make them responsive based on the size of the display without media queries?
@Hassiai
Posted
@fa7eh responsive content shrinks on smaller screens, prevent the content from overflowing and fit into the screen without changing anything in the content. Giving .card a max-width value means this value is the maximum width the content can have. e.g: max-width:400px` means the maximum width .card can have is 400px and can have any width below this value.
Hope am helpful.
Marked as helpful