Need help adding <link rel="stylesheet" href="styles.css"> when body comes first

Need help linking html file to css without having the head . Having trouble finishing project 4. Any tips? Thank you.

You might need the <head> element. Could you share your full code? Thanks.

Python Technical Documentation
<nav id="navbar">
  <ul id="nav">
  <header id="heading">
    PYTHON DOCUMENTATION
    </header>
  <li><a class="nav-link" href="#Introduction"> Introduction </a></li>
    
     <li><a class="nav-link" href="#Variables"> Variables </a></li>
    
    <li><a class="nav-link" href="#Set"> Set </a></li> 
    
    <li><a class="nav-link" href="#List"> List </a></li>
     
    <li><a class="nav-link" href="#Functions"> Functions </a></li>
     
    <li><a class="nav-link" href="#Comments"> Comments </a></li>
     
    <li><a class="nav-link" href="#Tuples">  Tuples </a></li>
  </ul>
</nav>

<main id="main-doc">
  <section id="Introduction" class="main-section">
    <header >
      Introduction
    </header>
    <p>
      
        <h4>What is Python?</h4>
        Python is a popular programming language. It was created by Guido van Rossum, and released in 1991.

It is used for:

  • web development (server-side),

  • HTML is the standard markup language for creating Web pages

  • HTML describes the structure of a Web page

  • HTML consists of a series of elements

  • HTML elements tell the browser how to display the content

  • HTML elements label pieces of content such as “this is a heading”, “this is a paragraph”, “this is a link”, etc.

  • Example of Python Syntax -

            print("Hello World")
          </code>
        </p>
      </section>
      
      
      <section id="Variables" class="main-section">
        <header >
          Variables
        </header>
        <p>
          Variables are containers for storing data values.
    
        <h5> Creating Variables</h5>
          <li>
            Python has no command for declaring a variable.</li>
    
          <li>      A variable is created the moment you first assign a value to it
          </li>
        <li>Variables do not need to be declared with any particular type, and can even change type after they have been set.</h5>
    
        <h5> Example</h5>
          <code>
            x = 5</code>
            <code>y = "John"</code>
            <code>print(x)</code>
    

    print(y)


      <section  id="Set"class="main-section">
        <header>
          Set
        </header>
        <p>Sets are used to store multiple items in a single variable.
          <li>
            Set is one of 4 built-in data types in Python used to store collections of data, the other 3 are List, Tuple, and Dictionary, all with different qualities and usage.</list>
    
        <li>A set is a collection which is unordered, unchangeable*, and unindexed.</li>
    
        <li> Set items are unchangeable, but you can remove items and add new items.</li>
    
        <li>Sets are written with curly brackets.  </li>
        <h5> Example</h5>
          <code>
            
            thisset = {"apple", "banana", "cherry"}</code>
            <code>print(thisset)
          </code>
        </p>
      </section>
      
      <section id="List" class="main-section">
        <header >
          List
        </header>
        <p>
          
          <li>
            Lists are used to store multiple items in a single variable.</li>
    
  • Lists are one of 4 built-in data types in Python used to store collections of data, the other 3 are Tuple, Set, and Dictionary, all with different qualities and usage.
  •       <li>Lists are created using square brackets</li>
          <h5> Example
            Create a List:</h5>
          <code>
            thislist = ["apple", "banana", "cherry"]
            <code>print(thislist)</code>
          </code>
        </p>
      </section>
      
      <section id="Functions" class="main-section">
        <header>
          Functions
        </header>
        <p>
          <li>
            A function is a block of code which only runs when it is called.</li>
    
          <li>You can pass data, known as parameters, into a function.</li>
    
          <li>A function can return data as a result</li>
          <li>In Python a function is defined using the def keyword</li>
        <h5> Example of Creating a Function </h5>
          <code>
            def my_function():</code>
            <code>print("Hello from a function")
          </code>
        </p>
      </section>
      
      <section id="Comments" class="main-section">
        <header>
          Comments
        </header>
        <p>
          <li>
            Comments can be used to explain Python code.</li>
    
            <li>Comments can be used to make the code more readable.</li>
    
            <li>Comments can be used to prevent execution when testing code.</li>
            
          <li> Comments starts with a #, and Python will ignore them</li> 
        <h5> Example</h5>
          <code>
            #This is a comment
    

    print(“Hello, World!”)


      <section id="Tuples" class="main-section">
        <header>
           Tuples
        </header>
        <p>
          <li>Tuples are used to store multiple items in a single variable.</li>
    
  • Tuple is one of 4 built-in data types in Python used to store collections of data, the other 3 are List, Set, and Dictionary, all with different qualities and usage.
  •       <li>A tuple is a collection which is ordered and unchangeable.</li>
    
  • Tuples are written with round brackets.
  • Example of Creating a Tuple-
    thistuple = ("apple", "banana", "cherry")
           <code> print(thistuple)
          </code>
        </p>
      </section>
    </main>

    Are you building this on Codepen.io? Or in the freecodecamp editor

    Hello, SOAR!
    I hope you’re doing great!

    Link elements are self-closing tag
    Have you checked that your <link /> is something like that!
    I hope that help!

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