Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

section 4 styling anchor tags archive has the wrong code #2

Closed
miahj1 opened this issue Aug 12, 2023 · 0 comments
Closed

section 4 styling anchor tags archive has the wrong code #2

miahj1 opened this issue Aug 12, 2023 · 0 comments

Comments

@miahj1
Copy link

miahj1 commented Aug 12, 2023

The archive diving-deeper-04-styling-anchor-tags-finished.zip has the incorrect code: it doesn't have anything related to styling anchor tags. I've included both before and after making the changes suggested in the videos so others following the course have a choice on where they want to start i.e. making the changes themselves or just taking the changes and looking over them.

The correct code should be as follows before implementing any of the changes in the section:

index.html

<!DOCTYPE html>
<html_lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <meta http-equiv="X-UA-Compatible" content="ie=edge">
   <title>CSS Course</title>
   <link rel="stylesheet" href="main.css">
</head>
<body>
   <nav>
      <a href="#intro" class="active">Intro</a>
      <a href="#outro">Outro</a>
   </nav>
   <section id="intro" class="main-section">
      <p>This is the intro section.</p>
   </section>
   <section id="outro" class="main-section">
      <p>This is the outro section.</p>
   </section>
</body>
</html>

main.css

body {
    font-family: sans-serif;
}

nav {
    margin-bottom: 16px;
    background: #fa923f;
    padding: 8px 0;
}

a {
    text-decoration: none;
    color: white;
    margin: 10px;
}

.main-section {
    height: 800px;
    border: 1px solid #ccc;
    padding: 16px;
}

The correct code after implementing the changes in the section:

index.html

<!DOCTYPE html>
<html_lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <meta http-equiv="X-UA-Compatible" content="ie=edge">
   <title>CSS Course</title>
   <link rel="stylesheet" href="main.css">
</head>
<body>
   <nav>
      <a href="#intro" class="active">Intro</a>
      <a href="#outro">Outro</a>
   </nav>
   <section id="intro" class="main-section highlighted">
      <p>This is the intro section.</p>
   </section>
   <section id="outro" class="main-section">
      <p>This is the outro section.</p>
   </section>
</body>
</html>

main.css

body {
    font-family: sans-serif;
}

nav {
    margin-bottom: 16px;
    background: #fa923f;
    padding: 8px 0;
}

a {
    text-decoration: none;
    color: white;
    margin: 10px;
}

a.active {
    color: #521751;
}

.main-section {
    height: 800px;
    border: 1px solid #ccc;
    padding: 16px;
}

.highlighted {
    border: 2px solid #fa923f;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants