
Design comparison
Solution retrospective
I'm proud that it looks like a decent webpage. I hope to learn how to create a responsive website soon, because right now it looks better on desktop than mobile.
What challenges did you encounter, and how did you overcome them?At first, none of the CSS styles I was creating was working. Turns out I forgot to link the style.css file to the index.html file.
What specific areas of your project would you like help with?I don't know how to change the layout to remove the colored background and enlarge the photo on mobile view. I'm also not sure whether I should be using 'class' or 'id' on the HTML elements.
Community feedback
- @DangelobastPosted 23 days ago
Amazing job, regarding your inquiry about fitting your image to the whole width of the content, it's good to think about what styles you have applied to it to be able to remove them when your viewport is smaller with queries.
Queries are applied when your dimensions reach a certain point, say 420x557, causing it to have more styles only when you get there.
Using your page as an example you have a padding set to 5% to your recipe class, meanwhile, it's for aligning the whole content it's also "centering" your image, so if you want your image to occupy the whole width you will have to remove that space there when your viewport reaches a specific point.
As a result of that and the way your HTML is structured your whole content won't have that beautiful separation, so you are gonna have to apply that padding to the rest of the content except for your image.
Keep in mind that you could add padding to each element but it's not the best approach.
Hope this helps!
Marked as helpful0@ysagohhPosted 12 days ago@Dangelobast Hello! Admittedly, I didn't understand your comment at first. But now that I've learned about media queries, I understand what you mean! I'll try editing my solution. 😃 Thanks for your feedback!
0 - @gautam-32b7Posted 23 days ago
Hi there!
Your solution looks amazing. In CSS, both
class
andid
are used as selectors to apply styles to HTML elements.class
: Target multiple elements with the same styles.id
: Target a single, unique element.I prefer the
class
selector for styling to keep CSS maintainable.I hope you find this helpful.
Marked as helpful0@ysagohhPosted 12 days ago@gautam-32b7 Hello, thanks for this tip! I've been using classes more often now because of your feedback.
1
Please log in to post a comment
Log in with GitHubJoin 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