Design a Business Card - Design a Business Card

Tell us what’s happening:

Check code keeps complaining:
Your p elements should have a top and bottom margin of 5px

But code looks OK .

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <title>Business Card</title>
    <link rel="stylesheet" href="styles.css" />

</head>

<body>
    <div class="business-card">
        <img src="https://cdn.freecodecamp.org/curriculum/labs/flower.jpg" class="profile-image" alt="Pink flower">
        <p class="full-name">Rob McCrackinIt</p>
        <p class="designation">Code Man!</p>
        <p class="company">Big Jobs</p>
        <hr>
        <p>RobMcCrackinIt@TIW.org</p>
        <p>0401809988</p>
        <a class="portfolio-link" href="https://github.com/">Portfolio</a>
        <hr class="portfolio-link">
    <div class="social-media">
        <h2>Connect with me</h2>
        <a class="portfolio-link" href="https://github.com/">Twitter</a>
        <a class="portfolio-link" href="https://github.com/">LinkedIn</a>
        <a class="portfolio-link" href="https://github.com/">GitHub</a>

    </div>

</body>

</html>
/* file: styles.css */
body {
font-family: Arial, sans-serif;
background-color: rosybrown;
}
.business-card {
  width: 300px;
  background-color: rgb(183, 183, 248);
  padding: 20px;
  margin: 100px 0px 0px 0px;
  text-align: center;
  font-size: 16px;
  margin-left: auto;
  margin-right: auto;
}

.profile-image {
  max-width: 100%;
}

.full-name {
  margin: 5px 0px; 
}

.designation {
  margin: 5px 0px; 
}

.company {
  margin: 5px 0px; 
}

.portfolio-link {
  text-decoration: none;
}

.social-media {

}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36

Challenge Information:

Design a Business Card - Design a Business Card

Hi @rob88blu, after running your code, look carefully at the errors you’re getting and try to fix them. You still have issues with these two requirements:

40. Your p elements should have a top and bottom margin of 5px.
41. The links on the page should have no underline.

Think about it — did you add a p selector? Did you style the a elements so the links appear without an underline?

hope it helps :blush:

Hi,

The underline is fine. I made a copy of my code before that anyway and tested it now, the underline doesn’t show on the links so that is correct.

In terms of the P elements. They are also correct as far as I can tell including the CSS.

Rob McCrackinIt

Code Warrior

WarriorIT

The only thing I’m thinking is after that you are asked to create 2 more p elements, but there are no instructions to assign any class to them. Maybe that’s what it is looking for? In the example below, I added inline styling to see if it would make any difference, it didn’t.

RobMcCrackinIt@TIW.org

0401809988

.

The other thing I don’t understand is that before thins line of code:

I thought we would have to close the div from above but if I do, it throws out the results, why don’t we?

Thanks.

Look at the requirements more carefully.

For requirement 40:

40. Your p elements should have a top and bottom margin of 5px.

You only styled .full-name, but the instruction is talking about all p elements, not just one specific class.

For requirement 41:

41. The links on the page should have no underline.

You only styled .portfolio-link, but the instruction refers to the page’s links in general, meaning you should check how you styled the a elements.

And about this part of your message:

The only thing I’m thinking is after that you are asked to create 2 more p elements, but there are no instructions to assign any class to them. Maybe that’s what it is looking for? In the example below, I added inline styling to see if it would make any difference, it didn’t.

Read this instruction one more time:

11. You should have another div element with a class attribute with a value of social-media. Within this element, there should be an h2 element with the text Connect with me.

Now think carefully about how the second div is supposed to be nested.