Stats preview card component responsive using HTML & CSS (GRID | FLEX)
Design comparison
Solution retrospective
Me resulto difícil a la hora de centrar la card en una vista mínima de 768px, pude resolverlo poniéndole un margin arriba y abajo y auto a los costados, aunque creo que no es la mejor opción. También tuve problemas para aplicar el color violeta a la imagen, probe con la propiedad filter pero no lo logre resolverlo. Si alguien me puede ayudar con el problema de la imagen lo agradezco. Sigo recibiendo feedback para poder mejorar. Desde ya, gracias. Saludos!
Community feedback
- @AdrianoEscarabotePosted almost 2 years ago
Hello valentin vera, how are you? I truly loved your project's outcome, however I have some advice that I hope you'll find useful:
To get closer to the photo overlay effect, you'd better use mix-blend-mode. All you need is the div under the image with this background color: hsl(277, 64%, 61%); and position mix-blend-mode: multiply and opacity: 80% on the image or apply image to activate the overlay by blending the image with the div's color. See the code below:
img { mix-blend mode: multiply; opacity: 80%; }
You can read this content which is explaining these effects with mix-blend-mode: click here
Consider using rem for font size .If your web content font sizes are set in absolute units, such as pixels, the user will not be able to re-size the text or control the font size based on their needs. Relative units “stretch” according to the screen size and/or user’s preferred font size, and work on a large range of devices.
if you want to continue coding with px, you can download a very useful extension in vscode, it converts px to rem! link -> px to rem
The remainder is excellent.
I hope it's useful. 👍
0 - @catherineisonlinePosted almost 2 years ago
For the image, I did something like this, I hope that helps:
<div class="image-container"> <img class="main-image" src="images/image-header-mobile.jpg" alt=""> </div>
.image-container { display: inherit; position: relative; width: 100%; border-radius: 0 10px 10px 0; background-color: hsl(277, 64%, 61%); } .main-image { width: 100%; height: 100%; position: relative; background-size: cover; border-radius: 0 10px 10px 0; mix-blend-mode: multiply; opacity: 0.75; }
0@valentinveraPosted almost 2 years ago¡Hola @catherineisonline! Muchas gracias por tu respuesta. El feedback si me sirvió solo que saque algunas líneas de código. También tuve un problema el cual es que abajo de la imagen me genera como un border el cual no puedo sacar con ninguna propiedad de border, probe poniendo none y valores como 0 pero no funciona. Acá te dejo el enlace de la página para que puedas ver https://preview-stats-card-component.netlify.app/
0
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