Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

article-preview-component-master

Tomas Scerbakā€¢ 720

@TomasScerbak

Desktop design screenshot for the Article preview component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I have no idea how to combine HTML, CSS and JS to show different layouts when click on share button :D. Could only finish mobile version.....somehow.

Any suggestion for best practice and how to do it would be appreciated.

Thank you

Community feedback

Yazdunā€¢ 1,310

@Yazdun

Posted

Hello dear Potato šŸ„”

allright there is so many ways to get this done, I mention two main approaches I personally take for these scenarios.

  • for this challenge, I used media queries. I mean it's a same component, as long as it is within small screens it sticks to the bottom, but as soon as it hits wider screens, it completely transforms into different styles, but it is still same css class ! here is my solution on this challenge in case you wanna check it out.

  • there is another approach you can take, you can create two different elements for mobile version and desktop version, and add display:none to desktop version, then using media queries, when user reaches wider screen you can add display:block to the desktop version and display:none to the mobile version. ( I guess it got a little bit confusing but I did my best šŸ˜ ). then using javascript you can toggle both these classes but always one of them is hidden according to the device's screen width.

I hope you find this comment helpful

Marked as helpful

0

Tomas Scerbakā€¢ 720

@TomasScerbak

Posted

@Yazdun Hi. display: none that was my approach but I think I have completely wrong HTML layout and also I don't know whether I should apply styles for arrow in JS or in CSS. I will check your solution definitelly. Thank you

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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