Ukaegbu Gray Nneji
@graynnejiAll comments
- @Gwen-lego@graynneji
You are almost there... Remove this max-width: 37em; from the wrapper class in your CSS and also remove media="(max-width: 33em) from your source tag in your HTML. Now when you load the page and reduce the size of your browser to like phone size. you will see the responsiveness it will be only one column. I have done it here and it works fine. try it out and let me know the result.
- P@cotybro@graynneji
Congratulations on completing this challenge When working with images in a web application, there are different ways to load them into your project. One way is to import individual images one by one, which can be time-consuming and cumbersome, especially when dealing with a large number of images. Alternatively, you can import the entire image folder or use the require function, which can simplify the process and make it more efficient.
Importing the entire image folder involves specifying the path to the folder containing all the images, and then accessing each image as needed. This approach can be useful when you have a large number of images, as it allows you to access them all at once without having to import them individually.
// Import all images in a folder const images = require.context('./images', true); // Access a specific image const myImage = images('./my-image.jpg');
Marked as helpful - @arfarobs
Audiophile | React | Firebase | Jest | ReactTestingLibrary | ReduxTool
#firebase#jest#react-testing-library#redux-toolkit#react@graynnejiAlright thanks... its actually this challenge I need help for. here is the link you requested for https://github.com/graynneji/audio-ecommerce-app
- @xdcron@graynneji
Another simple way to make it responsive without using media query.. Lets say you use grid for the main-container
.category-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); place-items: center text-align: center; }
Grid columns breaks after hitting 20rem of width. I hope this helps you in your future projects.
Marked as helpful - @NehalSahu8055@graynneji
Congratulations Some suggestions. To optimize your code and make it more readable you should use one for loop and you will still get the same result.
Marked as helpful - @arfarobs
Audiophile | React | Firebase | Jest | ReactTestingLibrary | ReduxTool
#firebase#jest#react-testing-library#redux-toolkit#react@graynnejiI have been trying to display my images in the asset folder but I keep getting Module not found, the only way I was able to load my images in my react app is when I upload those images in a server and I use the URL but when I want to load them locally I get that error except i import the image and I cannot import all images in all my components
- @Gwen-lego@graynneji
Very Clean Design but I will give you a solution that will help make your gird responsive without media query
.wrapper { background: white; border-radius: 0.5em; display: grid; grid-template-columns: repeat(auto-fit, minmax(37em, 1fr)); }
Grid columns break after hitting 37em of width
Marked as helpful - @vitu6569@graynneji
Congratulations I think you might want to learn more on typography.
Typography is an important aspect of web design that involves the selection of fonts, font sizes, line heights, and other stylistic elements to improve the readability and visual appeal of text. Here are some tips for using typography in CSS.
Line height: Use a line height that is appropriate for the font size and improves the readability of the text. A good rule of thumb is to use a line height of 1.5 to 1.6 times the font size. You can use the line-height property in CSS to specify the line height, like this:
body { font-size: 16px; line-height: 1.5; }
For smaller font you bigger line height while for bigger font you use a smaller line Height
Letter spacing: Use letter spacing to improve the readability of the text. You can use the letter-spacing property in CSS to specify the letter spacing, like this:
h1 { letter-spacing: 0.1em; }
In this example, a small amount of letter spacing is added to the h1 element to improve the readability of the text.
By following these guidelines, you can create effective typography in CSS that improves the readability and visual appeal of your text.
Marked as helpful - @siavhnz@graynneji
Very nice. But I have a suggestion for you. Your country cards are not aligning with one another I suggest you specify a height in order to make the of the same height.
- @KamalAborida@graynneji
you can use the browser Geolocation API
- @maxibrain4@graynneji
This is an Excellent Job I think you should work on your typography, use some letter spacing and font-size, font-family to give your text a professional appearance
- @amrajat@graynneji
Using display: inline-flex on the picture tag to remove unnecessary white space is a valid solution. However, there might be a better way to approach it depending on the specific use case and design requirements.
One possible alternative solution is to set the height of the picture tag to 100%, and then use object-fit: cover on the img element inside the picture tag. This will ensure that the image fills the available height of the picture tag without distorting its aspect ratio. Here's an example:
<picture style={{ height: "100%" }}> <img srcSet="image-small.jpg 480w, image-medium.jpg 768w, image-large.jpg 1200w" sizes="(max-width: 600px) 480px, (max-width: 768px) 768px, 1200px" src="image-large.jpg" alt="Alt Text" style={{ objectFit: "cover", width: "100%", height: "100%" }} /> </picture>
With this approach, you can avoid using display: inline-flex and rely on CSS properties specifically designed for handling images, such as object-fit. This can make your code more readable and maintainable, and also help ensure that your images display correctly across different devices and screen sizes.
I hope this helps!
Marked as helpful - @Slaks97@graynneji
To make the hero-img fit inside its parent div, you can use the object-fit property with a value of cover. This will scale the image to be as large as possible while still fitting inside its container, without distorting its aspect ratio.
To make the image have rounded corners to match the design, you can use the border-radius property on the parent div. This will apply the same rounded corners to the image as well, without the need for additional styles.
<div className="hero-container"> <img src="https://www.linkpicture.com/q/image-hero.jpg" alt="Hero Image" className="hero-img" /> </div>
.hero-container { position: relative; height: 300px; overflow: hidden; border-radius: 10px; } .hero-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
With these styles, the hero-img will be positioned absolutely inside its parent container, with a width and height of 100% to fill the container.
I hope this helps
Marked as helpful - @zafeerwains@graynneji
Nice work done. you should put some padding in the search box and the drop down menu
- @graynneji@graynneji
Thanks a lot for your comments I will make adjustments