The problem that I'm having is that when I click the button , I have to press it twice to go to the next advice Is the api the problem, or there's a different reason for it?
Fer
@fernandolapazAll comments
- @turboo-sySubmitted 7 months agoWhat challenges did you encounter, and how did you overcome them?@fernandolapazPosted 7 months ago
Hello, regarding your question:
On the API site https://api.adviceslip.com you can see the note "Advice is cached for 2 seconds. Any repeat-request within 2 seconds will return the same piece of advice."
That is the reason.
I hope this clarifies your doubt.
Greetings,
1 - @maurocraviSubmitted 10 months ago
I created this using Google IDX because I wanted to try it out. I noticed that the borders of the card didn't start at the begining of the borders but just a little after. I didn't know how to do it after trying a few things, so it's not 100% accurate
@fernandolapazPosted 10 months agoHi, regarding your comment:
It is a shadow not a border, so you could have used the box-shadow property for that.
Something like this
box-shadow: 8px 8px black;
I hope it’s useful!
1 - @Priyesh-Singh-WaldiaSubmitted over 1 year ago
I still need a little bit of help with the hover effect for the image. A solution to that problem would mean a lot to me
@fernandolapazPosted over 1 year agoHi 👋🏻, regarding your comment:
- You could have used
background-color: hsla(178, 100%, 50%, 0.5)
and thenopacity: 1
on hover, like so:
.bg { position: absolute; opacity: 0; width: 300px; height: 300px; border-radius: 10px; background-color: hsla(178, 100%, 50%, 0.5); display: flex; justify-content: center; align-items: center; } .bg:hover { opacity: 1; cursor: pointer; }
- And remember that when there is a hover state over an element it means that it is interactive, so there must be an interactive element around it (like a link or a button). So, the image should be wrapped with
<a>
or<button>
(depending on what happened when clicking on it), and also 'Equilibrium #3429' and 'Jules Wyvern' should be wrapped with the<a>
tag.
I hope it’s useful : )
Regards,
Marked as helpful0 - You could have used
- @younesadjoudjSubmitted over 1 year ago
This is my solution for the challenge "Stats preview card component". Please, any feedback is welcome. Thank you.
@fernandolapazPosted over 1 year agoHi 👋🏻, some of this may interest you for future projects:
- To group a set of related items, like the stats in this case, you could use an unordered list
<ul>
.
- It might be good to get used to designing with the
mobile-first
approach (which means designing for mobile first and then for desktop or any other device) as it is widely considered best practice.
- As an alternative to color the image you could simply use the
mix-blend-mode
property:
.image { background-color: var(--clr-primary-soft-violet); } .image img { mix-blend-mode: multiply; opacity: 0.75; }
I hope it’s useful : )
Regards,
Marked as helpful0 - To group a set of related items, like the stats in this case, you could use an unordered list
- @Yahir-amSubmitted over 1 year ago
Hi! , If you have any suggestion or feedback will be appreciated. 😃
@fernandolapazPosted over 1 year agoHi 👋🏻, some of this may interest you for future projects:
- When there is a hover state over an element it means that it is interactive, so it should be an interactive element around it (like a link or a button). So, the image should be wrapped with
<a>
or<button>
(depending on what happened when clicking on it), and also 'Equilibrium #3429' and 'Jules Wyvern' should be wrapped with the<a>
tag.
- In cases like this where the content is centered on the page it is better to use
min-height: 100vh
for the body as usingheight
causes the page to be cut off in viewports with small height (such as mobile landscape orientation).
- Consider using rem for
font-size
as well as it is better for scalable layouts.
I hope it’s useful : )
Regards,
Marked as helpful1 - When there is a hover state over an element it means that it is interactive, so it should be an interactive element around it (like a link or a button). So, the image should be wrapped with
- @SorpandaSubmitted over 1 year ago@fernandolapazPosted over 1 year ago
Hi Soraya, nice solution,
Just in case you are not aware:
The trick of setting
font size: 62.5%
is no longer commonly recommended, actually there is still a lot of debate about it. In any case, it could be good to get used to thinking directly in relative units since they are the most suitable for most cases.I hope it’s useful : )
Regards,
Marked as helpful1 - @DribbzSubmitted over 1 year ago
Hi there 👋🏼, I’m Dribbz and this is my solution for this challenge. 🚀
🛠️ Built With:
⚡️HTML5 ⚡️Vanilla CSS
The measurments between elements could've been more accurate i am trying to work on my semantic HTML / accesibility if you have any tips for me would be great🙌🏼
Thank you !✌️
@fernandolapazPosted over 1 year agoHi Dribbz, just a couple of little tips in case you want to take a look:
- If you use
padding
instead ofmargin
for the<body>
it will avoid the vertical scrollbar you currently have.
- And if you want to remove the empty space below the image between 600 and 605px (I guess you didn't even see it) you could do it by giving it a
height: 100%
.
- Regarding your comment, I personally don't see any problem in terms of semantics/accessibility. 👌🏻
I hope it’s useful, nice solution : )
Regards,
Marked as helpful1 - If you use
- @shadow16305Submitted over 1 year ago
First time using tailwind CSS. I'm sure there is an easier way to change the color of the image (would want some advice for that if possible). Thanks for checking out my solution :D
@fernandolapazPosted over 1 year agoHi 👋🏻, regarding your comment:
- You could use the
mix-blend-mode
property that specifies how an element's content should blend with its direct parent background. So, set the soft violetbackground-color
to the image container and then:
.img-color { mix-blend-mode: multiply; opacity: 0.75; }
And some of this may also interest you:
- If you want to remove the empty space below the image between 768 and 940px you could do it by giving it a
height: 100%
. And if the image stretches too much you can addobject-fit: cover
. - To group a set of related items, like the statistics in this case, you could use an unordered list
<ul>
. - It is better to use
min-height: 100vh
('h-screen') as usingheight
causes the page to be cut off in viewports with small height (such as mobile landscape orientation). - Think about using relative units since they are better for scalable layouts. Something simple to start with would be to convert to rem (1 rem equals 16px by default), consider this suggestion especially for the
font-size
.
I hope it’s useful, and let me know if it worked : )
Regards,
0 - You could use the
- @helmdyckSubmitted over 1 year ago
I couldn't center everything with flexbox so I used "Transform : Translate ". What is the best way to center a simple div like this? Will I always have to try all the options until I see which one works for me?
@fernandolapazPosted over 1 year agoHi 👋🏻, regarding your comment:
You could center the content with grid or flexbox:
body { min-height: 100vh; display: grid; place-content: center; }
body { min-height: 100vh; display: flex; justify-content: center; align-items: center; }
One advantage of this over using translate is to avoid page clipping in viewports with low height (such as mobile landscape orientation).
I hope it’s useful : )
Regards,
Marked as helpful1 - @FerneyMontoya6Submitted over 1 year ago
If someone have some feedback I'd really like to know it 😊
@fernandolapazPosted over 1 year agoHi 👋🏻, some of this may interest you:
- The trick of setting
font size: 62.5%
is no longer commonly recommended, and it is good to get used to thinking directly in relative units since they are the most suitable for most cases. More about the 62.5% trick here 📗
- You should remove the
media
from<link rel="stylesheet" href="css/styles.css" media="screen and (min-width:375px)">
. It is not necessary and it makes the page not have styles below that width.
I hope it’s useful : )
Regards,
Marked as helpful1 - The trick of setting
- @HarlowRMSubmitted over 1 year ago
Any feedback is appreciated, Thank you!
@fernandolapazPosted over 1 year agoHi 👋🏻, some of this may interest you:
- The image is interactive too, so it should be wrapped with
<a>
or<button>
(depending on what happened when clicking on it).
- The icons are decorative and therefore need an
empty alt
attribute to be ignored by screen readers.
- It is better to use
min-height: 100vh
for the body as usingheight
causes the page to be cut off in viewports with small height (such as mobile landscape orientation).
- Think about using relative units since they are better for scalable layouts. Something simple to start with would be to convert to rem (1 rem equals 16px by default), consider this suggestion especially for the
font-size
.
I hope it’s useful : )
Regards,
Marked as helpful1 - The image is interactive too, so it should be wrapped with
- @Mahmoudamin11Submitted over 1 year ago
Any feedback please to reduce the unnecessary code :)
@fernandolapazPosted over 1 year agoHi 👋🏻, some of this may interest you:
- The image is not decorative and therefore the
alt
attribute should have at least a short description, like 'QR code to visit Frontend Mentor'.
- It is better to use
min-height: 100vh
for the body as usingheight
causes the page to be cut off in viewports with small height (such as mobile landscape orientation).
- Regarding what you mention about reducing unnecessary code, the only thing I see is that you could remove
font-weight: bold
from the <h2>.
I hope it’s useful : )
Regards,
Marked as helpful0 - The image is not decorative and therefore the