Hi, can you help me solve this problem

Tell us what’s happening:
What can i do to seperate the #navbar and the header

Your code so far

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

HTML
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Piano</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="./styles.css">
  </head>
  <body>
    <nav id="navbar">
      <header>JS Documentation</header>
      <ul>
        <li>
          <a class="nav-link" href="#Introduction">Introduction</a>
        </li>
                <li>
                  <a class="nav-link" href="#What you should already know">What you should already know</a>
                </li>
                        <li>
                          <a class="nav-link" href="#JavaScript and Java" >JavaScript and Java</a>
                        </li>
                                <li>
                                  <a class="nav-link" href="#Hello world" >Hello world</a>
                                </li>
                                        <li>
                                          <a class="nav-link" href="#Variables">Variables</a>
                                        </li>
                                                <li>
                                                  <a class="nav-link" href="#Declaring variables">Declaring variables</a>
                                                </li>
                                                        <li>
                                                          <a class="nav-link" href="#Variable scope">Variable scope</a>
                                                        </li>
                                                                <li>
                                                                  <a class="nav-link" href="#Global variables">Global variables</a>
                                                                </li>
        <li>
          <a class="nav-link" 
 href="#Constants">Constants</a>
        </li>
                <li>
                  <a class="nav-link" href="#Data types">Data types</a>
                </li>
                        <li>
                          <a class="nav-link" href="#Reference">Reference</a>
                        </li>

      </ul>
    </nav>
    <main id="main-doc">
      <section class="main-section" id="Introduction">
        <header>Introduction</header>
        <article><p></p>
        <ul>
              <li></li>      
              <li></li>

        </ul>
        </article>
        </section>
        <section class="main-section" id="What_you_should_already_know">
        <header>What you should already know</header>
        <article><p></p>
        <ul>
          <li></li>
          <li></li>
          <li></li>
        </ul>
        </article>
        </section>
        <section class="main-section" id="JavaScript_and_Java">
        <header>JavaScript and Java</header>
        <article><p></p></article>
        </section>
        <section class="main-section" id="Hello_world">
        <header>Hello world</header>
        <article><p></p>
        <code>function greetMe(yourName) { alert("Hello " + yourName); }
greetMe("World");</code>
        </article>
        </section>
        <section class="main-section" id="Variables">
        <header>Variables</header>
        <article><p></p></article>
        </section>
        <section class="main-section" id="Declaring_variables">
        <header>Declaring variables</header>
<article>
  <p>
    <code></code>
  </p>
  <p>
        <code></code>
  </p>
<p>
      <code></code>
</p>
</article>
        </section>
        <section class="main-section" id="Variable_scope">
        <header>Variable scope</header>
<article>
  <p></p>
  <p>
    <code></code>
  </p>
  <p></p>
<code></code>
</article>
        </section>
        <section class="main-section" id="Global_variables">
        <header>Global variables</header>
        <article><p></p>
        
        </article>
        </section>
        <section class="main-section" id="Constants">
        <header>Constants</header>
        <article>
          <p><code></code></p>
<p></p>
<p></p>
<p></p>
<code></code>
<code></code>
        </article>
        </section>
        <section class="main-section" id="Data_types">
        <header>Data types
</header>
<article><p></p></article>
        
        </section>
        <section class="main-section" id="Reference">
        <header>Reference
</header>
<article><p></p></article>
        
        </section>
    </main>
  </body>
  </html>

CSS
#navbar a{
  display: block;
  padding:10px 30px;
  color:#4d4e53;
  text-decoration:none;
  cursor:pointer;
}
#navbar{
  position: fixed;
    min-width: 290px;
    top: 0px;
    left: 0px;
    width: 300px;
    height: 100%;
    border-right: solid;
    border-color: rgba(0, 22, 22, 0.4);

}
#main-doc header{
  text-align: left;
  margin:0;
}
header{
  display:block;
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36

Challenge: Build a Technical Documentation Page

Link to the challenge:

1 Like

Hi @vuongtritung

I am not sure how to help you, I cannot see your code so far and I am not sure about your problem.
Anyway if you want white space between elements you will need the margin property, if you want extra space into the element, you should use padding. And if they are flex or grid elements you might consider gap property.

You can check anything related in the above links.
I hope that helps you. Dont give up.
Happy coding! :muscle: :sunglasses:

1 Like

Please edit the Article and put the code because its better than the screenshot

1 Like

Hello my friend, thank you for answering my question, I have added my code so far, please help me and have a good day

1 Like

I have added my code so far, can you help me please., Thank you so much

Hi @vuongtritung

I think it is always better copy and paste some things, like your classes and IDs names, for example. You are probably missing some underscores in links.
I hope that helps.
Happy coding!

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.