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

Newbie HTML and CSS

@Eleniyan-code

Desktop design screenshot for the NFT preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

Dongmo Shu 280

@dongmo-shu

Posted

Nice. That is a great attempt at the challenge.

I don't recommend having the site styling inside of the HTML code. Create a CSS file, insert the styling, and link the file to your HTML code. You can do that by adding <link rel="stylesheet" href="filename.css"> into the <head> section. Make sure both files are in the same folder.

Next up, the body needs to be at the centre of the page. there are many ways to do it. This is the most efficient I found.

body{
    background-color: hsl(217, 54%, 11%);
    height: 100vh;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    font-family: "Outfit", sans-serif;
}

The hover effect on the image, Our Equilibrium collection promotes balance and calm. and Jules Wyvern is missing.

For the hover effect on the image, and adding the eye icon, here is my take.

HTML

            <div class="equilibrium">
                <img class="image-equilibrium" src="../images/image-equilibrium.jpg" alt="equilibrium-image">
                <div class="overlay">
                    <img class="icon-view" src="../images/icon-view.svg" alt="view-icon">
                </div>
            </div>

CSS

.equilibrium{
    position: relative;
    overflow: hidden;
    max-height: 280px;
}

.image-equilibrium{
    height: 100%;
    border-radius: 10px;
}

.overlay{
    background: hsla(178, 100%, 50%, 0.4);
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;    
    height: 100%;
    width: 100%;
    opacity: 0;
    transition: .5s ease;
    border-radius: 10px;
}

.overlay:hover{
    opacity: 1;
}

.icon-view {
    position: absolute;
    top:42%;
    left: 42%;
    transition: 0.3s opacity;
}

Make sure to make any modifications necessary.

I hope this is helpful. If you have any questions, feel free to ask.

Marked as helpful

0

@Eleniyan-code

Posted

I am grateful for the feedback, I will implement the upgrade, thanks for taking your time to go through my solution @Singraft

1

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