Setting nav bar to scroll with a media query. css html

Hi guys when my page is full screen the main content scrolls and nav is fixed.

What I would like to do is set the nav to a smaller heigher (e.g. 250px) and have the nav links scroll to take up less space.

I can’t see all of the nav when it is set to scroll.

Code below! I have used a CSS style reset not shown.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="styles.css">
    <title>Javascript page</title>
</head>
<body>
<div id="wrapper">
    <header>
    <nav>
<h1>JS DOCUMENTATION</h1>
<ul class="navlinks">
    <li class="navlink"><a class="link" href="#intro">Introduction</a></li>
    <li class="navlink"><a href="#what2">What you should already know</a></li>
    <li class="navlink"><a href="#java3">Javascript and Java</a></li>
    <li class="navlink"><a href="#hello4">Hello world</a></li>
    <li class="navlink"><a href="#var5">Variables</a></li>
    <li class="navlink"><a href="#decl6">Declaring Variables</a></li>
    <li class="navlink"><a href="#var6">Variable Scope</a></li>
    <li class="navlink"><a href="#glob7">Global variables</a></li>
    <li class="navlink"><a href="#const8">Constants</a></li>
    <li class="navlink"><a href="data9">Data types</a></li>
</ul>
    </nav>
    </header>

    <main>
        <section class="intro" id="intro1">
            <h2 class="section-title">Introduction</h2>

            <p class="content">
                JavaScript is a cross-platform, object-oriented scripting language. It is a small and lightweight language. Inside a
                host environment (for example, a web browser), JavaScript can be connected to the objects of its environment to provide
                programmatic control over them.
            </p>
            <p class="content">
                JavaScript contains a standard library of objects, such as Array, Date, and Math, and a core set of language elements
                such as operators, control structures, and statements. Core JavaScript can be extended for a variety of purposes by
                supplementing it with additional objects; for example:
            </p>

            <ul class="content-bullet">
                <li class="bullet">Client-side JavaScript extends the core language by supplying objects to control a browser and its Document Object Model
                (DOM). For example, client-side extensions allow an application to place elements on an HTML form and respond to user
                events such as mouse clicks, form input, and page navigation.</li>
                <li class="bullet">Server-side JavaScript extends the core language by supplying objects relevant to running JavaScript on a server. For example, server-side extensions allow an application to communicate with a database, provide continuity of information
                from one invocation to another of the application, or perform file manipulations on a server.</li>
            </ul>
        </section>

        <section class="What-you-know" id="what2">
            <h2 class="section-title">What you should already know</h2>

            <p class="content">
                This guide assumes you have the following basic background:
            </p>

            <ul class="content-bullet">
                <li class="bullet">A general understanding of the Internet and the World Wide Web (WWW).</li>
                <li class="bullet">Good working knowledge of HyperText Markup Language (HTML).</li>
                <li class="bullet">Some programming experience. If you are new to programming, try one of the tutorials linked on the main page about JavaScript.</li>
                </ul>

        </section>

        <section class="java" id="java3">
            <h2 class="section-title">Javascript and Java</h2>
            <p class="content">
            JavaScript and Java are similar in some ways but fundamentally different in some others. The JavaScript language resembles Java but does not have Java's static typing and strong type checking. JavaScript follows most Java expression
            syntax, naming conventions and basic control-flow constructs which was the reason why it was renamed from LiveScript to
            JavaScript.</p>

            <p class="content">
                In contrast to Java's compile-time system of classes built by declarations, JavaScript supports a runtime system based
                on a small number of data types representing numeric, Boolean, and string values. JavaScript has a prototype-based
                object model instead of the more common class-based object model. The prototype-based model provides dynamic
                inheritance; that is, what is inherited can vary for individual objects. JavaScript also supports functions without any
                special declarative requirements. Functions can be properties of objects, executing as loosely typed methods.
            </p>




        </section>

        <section class="Hello-world" id="hello4">
                <h2 class="section-title">Hello World</h2>
                <p class="content">
                    To get started with writing JavaScript, open the Scratchpad and write your first "Hello world" JavaScript code:
                </p>
                <code>
                    function greetMe(yourName) { alert("Hello " + yourName); }
                    greetMe("World");
                </code>

                <p class="content">
                    Select the code in the pad and hit Ctrl+R to watch it unfold in your browser!
                </p>

        </section>

        <section class="Variables" id="var5">
            <h2 class="section-title">Variables</h2>
            <p class="content">
                You use variables as symbolic names for values in your application. The names of variables, called identifiers, conform
                to certain rules.
                
                A JavaScript identifier must start with a letter, underscore (_), or dollar sign ($); subsequent characters can also be
                digits (0-9). Because JavaScript is case sensitive, letters include the characters "A" through "Z" (uppercase) and the
                characters "a" through "z" (lowercase).
                
                You can use ISO 8859-1 or Unicode letters such as å and ü in identifiers. You can also use the Unicode escape sequences
                as characters in identifiers. Some examples of legal names are Number_hits, temp99, and _name.
            </p>

        </section>

        <section class="Declaring-variables" id="decl6">
            <h2 class="section-title">Declaring variables</h2>
                        <p class="content">
                            JavaScript and Java are similar in some ways but fundamentally different in some others. The JavaScript language
                            resembles Java but does not have Java's static typing and strong type checking. JavaScript follows most Java
                            expression
                            syntax, naming conventions and basic control-flow constructs which was the reason why it was renamed from LiveScript
                            to
                            JavaScript.</p>
                        
                        <p class="content">
                            In contrast to Java's compile-time system of classes built by declarations, JavaScript supports a runtime system
                            based
                            on a small number of data types representing numeric, Boolean, and string values. JavaScript has a prototype-based
                            object model instead of the more common class-based object model. The prototype-based model provides dynamic
                            inheritance; that is, what is inherited can vary for individual objects. JavaScript also supports functions without
                            any
                            special declarative requirements. Functions can be properties of objects, executing as loosely typed methods.
                        </p>
        </section>

        <section class="Variable-scope" id="var6">
            <h2 class="section-title">Variable-scope</h2>
                        <p class="content">
                            JavaScript and Java are similar in some ways but fundamentally different in some others. The JavaScript language
                            resembles Java but does not have Java's static typing and strong type checking. JavaScript follows most Java
                            expression
                            syntax, naming conventions and basic control-flow constructs which was the reason why it was renamed from LiveScript
                            to
                            JavaScript.</p>
                        
                        <p class="content">
                            In contrast to Java's compile-time system of classes built by declarations, JavaScript supports a runtime system
                            based
                            on a small number of data types representing numeric, Boolean, and string values. JavaScript has a prototype-based
                            object model instead of the more common class-based object model. The prototype-based model provides dynamic
                            inheritance; that is, what is inherited can vary for individual objects. JavaScript also supports functions without
                            any
                            special declarative requirements. Functions can be properties of objects, executing as loosely typed methods.
                        </p>
        </section>

        <section class="Global-variables" id="glob7">
            <h2 class="section-title">Global Variables</h2>
                        <p class="content">
                            JavaScript and Java are similar in some ways but fundamentally different in some others. The JavaScript language
                            resembles Java but does not have Java's static typing and strong type checking. JavaScript follows most Java
                            expression
                            syntax, naming conventions and basic control-flow constructs which was the reason why it was renamed from LiveScript
                            to
                            JavaScript.</p>
                        
                        <p class="content">
                            In contrast to Java's compile-time system of classes built by declarations, JavaScript supports a runtime system
                            based
                            on a small number of data types representing numeric, Boolean, and string values. JavaScript has a prototype-based
                            object model instead of the more common class-based object model. The prototype-based model provides dynamic
                            inheritance; that is, what is inherited can vary for individual objects. JavaScript also supports functions without
                            any
                            special declarative requirements. Functions can be properties of objects, executing as loosely typed methods.
                        </p>
        </section>

        <section class="Constants" id="const8">
            <h2 class="section-title">Constants</h2>
                        <p class="content">
                            JavaScript and Java are similar in some ways but fundamentally different in some others. The JavaScript language
                            resembles Java but does not have Java's static typing and strong type checking. JavaScript follows most Java
                            expression
                            syntax, naming conventions and basic control-flow constructs which was the reason why it was renamed from LiveScript
                            to
                            JavaScript.</p>
                        
                        <p class="content">
                            In contrast to Java's compile-time system of classes built by declarations, JavaScript supports a runtime system
                            based
                            on a small number of data types representing numeric, Boolean, and string values. JavaScript has a prototype-based
                            object model instead of the more common class-based object model. The prototype-based model provides dynamic
                            inheritance; that is, what is inherited can vary for individual objects. JavaScript also supports functions without
                            any
                            special declarative requirements. Functions can be properties of objects, executing as loosely typed methods.
                        </p>
        </section>

        <section class="Data-types" id="data9">
            <h2 class="section-title">Data types</h2>
                        <p class="content">
                            JavaScript and Java are similar in some ways but fundamentally different in some others. The JavaScript language
                            resembles Java but does not have Java's static typing and strong type checking. JavaScript follows most Java
                            expression
                            syntax, naming conventions and basic control-flow constructs which was the reason why it was renamed from LiveScript
                            to
                            JavaScript.</p>
                        
                        <p class="content">
                            In contrast to Java's compile-time system of classes built by declarations, JavaScript supports a runtime system
                            based
                            on a small number of data types representing numeric, Boolean, and string values. JavaScript has a prototype-based
                            object model instead of the more common class-based object model. The prototype-based model provides dynamic
                            inheritance; that is, what is inherited can vary for individual objects. JavaScript also supports functions without
                            any
                            special declarative requirements. Functions can be properties of objects, executing as loosely typed methods.
                        </p>
        </section>
    </main>
    </div>
</body>
</html>

<styles>
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}
body {
  line-height: 1;
}
/* ol,
ul {
  list-style: none;
} */
blockquote,
q {
  quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
  content: "";
  content: none;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}

@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Lato:<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7c0b1b14083c484c4c">[email protected]</a>;700;900&family=Montserrat:<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2255454a5662131212">[email protected]</a>&display=swap");

* {
  box-sizing: border-box;
}

body {
  height: 100vh;
  overflow: hidden;
  font-family: "Lato", sans-serif;
}

#wrapper {
  display: flex;
  height: 100%;
}

header {
  border-right: solid grey 2px;
}

h1 {
  font-size: 1.5rem;
  padding: 20px 20px;
  color: black;
}

nav {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.navlink {
  list-style-type: none;
  border-top: solid black 1px;
  padding: 10px 10px;
}

a {
  text-decoration: none;
  color: rgb(77, 75, 75);
}

main {
  overflow: auto;
  width: 700px;
  flex-grow: 1;
  padding: 30px 50px;
  color: rgb(77, 75, 75);
}

.section-title {
  font-size: 1.5rem;
  padding: 20px 0px;
  color: black;
}

.content {
  padding: 10px 10px;
  word-spacing: 0.2em;
}

.content-bullet {
  padding: 15px 40px;
}

.bullet {
  padding: 10px 0px;
}

@media (max-width: 768px) {
  #wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  header {
    border-right: solid white 2px;
  }

  body {
    overflow: hidden;
  }

  main {
    width: 100%;
    flex-grow: 1;
    padding: 20px 10px;
    color: rgb(77, 75, 75);
  }


  nav {
    height: 200px;
    overflow: scroll;
  }

  .navlink {
    list-style-type: none;
    border-top: solid black 1px;
    border-bottom: solid black 1px;
    padding: 10px 10px;
  }
}
</styles>

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Here you go…

Add this to your CSS:

.navlinks {
  overflow-y: scroll;
  height: 250px;
}

See the snippet below.

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}


/* HTML5 display-role reset for older browsers */

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}

body {
  line-height: 1;
}


/* ol,
ul {
  list-style: none;
} */

blockquote,
q {
  quotes: none;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
  content: "";
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Lato:[email protected];700;900&family=Montserrat:[email protected]&display=swap");
* {
  box-sizing: border-box;
}

body {
  height: 100vh;
  overflow: hidden;
  font-family: "Lato", sans-serif;
}

#wrapper {
  display: flex;
  height: 100%;
}

header {
  border-right: solid grey 2px;
}

h1 {
  font-size: 1.5rem;
  padding: 20px 20px;
  color: black;
}

nav {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.navlink {
  list-style-type: none;
  border-top: solid black 1px;
  padding: 10px 10px;
}

a {
  text-decoration: none;
  color: rgb(77, 75, 75);
}

main {
  overflow: auto;
  width: 700px;
  flex-grow: 1;
  padding: 30px 50px;
  color: rgb(77, 75, 75);
}

.section-title {
  font-size: 1.5rem;
  padding: 20px 0px;
  color: black;
}

.content {
  padding: 10px 10px;
  word-spacing: 0.2em;
}

.content-bullet {
  padding: 15px 40px;
}

.bullet {
  padding: 10px 0px;
}

@media (max-width: 768px) {
  #wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  header {
    border-right: solid white 2px;
  }
  body {
    overflow: hidden;
  }
  main {
    width: 100%;
    flex-grow: 1;
    padding: 20px 10px;
    color: rgb(77, 75, 75);
  }
  nav {
    height: 200px;
    overflow: scroll;
  }
  .navlink {
    list-style-type: none;
    border-top: solid black 1px;
    border-bottom: solid black 1px;
    padding: 10px 10px;
  }
}

.navlinks {
  overflow-y: scroll;
  height: 250px;
}
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="styles.css" rel="nofollow noreferrer noopener">
  <title>Javascript page</title>
</head>

<body>
  <div id="wrapper">
    <header>
      <nav>
        <h1>JS DOCUMENTATION</h1>
        <ul class="navlinks">
          <li class="navlink"><a class="link" href="#intro" rel="nofollow noreferrer noopener">Introduction</a></li>
          <li class="navlink"><a href="#what2" rel="nofollow noreferrer noopener">What you should already know</a></li>
          <li class="navlink"><a href="#java3" rel="nofollow noreferrer noopener">Javascript and Java</a></li>
          <li class="navlink"><a href="#hello4" rel="nofollow noreferrer noopener">Hello world</a></li>
          <li class="navlink"><a href="#var5" rel="nofollow noreferrer noopener">Variables</a></li>
          <li class="navlink"><a href="#decl6" rel="nofollow noreferrer noopener">Declaring Variables</a></li>
          <li class="navlink"><a href="#var6" rel="nofollow noreferrer noopener">Variable Scope</a></li>
          <li class="navlink"><a href="#glob7" rel="nofollow noreferrer noopener">Global variables</a></li>
          <li class="navlink"><a href="#const8" rel="nofollow noreferrer noopener">Constants</a></li>
          <li class="navlink"><a href="data9" rel="nofollow noreferrer noopener">Data types</a></li>
        </ul>
      </nav>
    </header>

    <main>
      <section class="intro" id="intro1">
        <h2 class="section-title">Introduction</h2>

        <p class="content">
          JavaScript is a cross-platform, object-oriented scripting language. It is a small and lightweight language. Inside a host environment (for example, a web browser), JavaScript can be connected to the objects of its environment to provide programmatic control
          over them.
        </p>
        <p class="content">
          JavaScript contains a standard library of objects, such as Array, Date, and Math, and a core set of language elements such as operators, control structures, and statements. Core JavaScript can be extended for a variety of purposes by supplementing it
          with additional objects; for example:
        </p>

        <ul class="content-bullet">
          <li class="bullet">Client-side JavaScript extends the core language by supplying objects to control a browser and its Document Object Model (DOM). For example, client-side extensions allow an application to place elements on an HTML form and respond to user events
            such as mouse clicks, form input, and page navigation.</li>
          <li class="bullet">Server-side JavaScript extends the core language by supplying objects relevant to running JavaScript on a server. For example, server-side extensions allow an application to communicate with a database, provide continuity of information from
            one invocation to another of the application, or perform file manipulations on a server.</li>
        </ul>
      </section>

      <section class="What-you-know" id="what2">
        <h2 class="section-title">What you should already know</h2>

        <p class="content">
          This guide assumes you have the following basic background:
        </p>

        <ul class="content-bullet">
          <li class="bullet">A general understanding of the Internet and the World Wide Web (WWW).</li>
          <li class="bullet">Good working knowledge of HyperText Markup Language (HTML).</li>
          <li class="bullet">Some programming experience. If you are new to programming, try one of the tutorials linked on the main page about JavaScript.</li>
        </ul>

      </section>

      <section class="java" id="java3">
        <h2 class="section-title">Javascript and Java</h2>
        <p class="content">
          JavaScript and Java are similar in some ways but fundamentally different in some others. The JavaScript language resembles Java but does not have Java's static typing and strong type checking. JavaScript follows most Java expression syntax, naming conventions
          and basic control-flow constructs which was the reason why it was renamed from LiveScript to JavaScript.
        </p>

        <p class="content">
          In contrast to Java's compile-time system of classes built by declarations, JavaScript supports a runtime system based on a small number of data types representing numeric, Boolean, and string values. JavaScript has a prototype-based object model instead
          of the more common class-based object model. The prototype-based model provides dynamic inheritance; that is, what is inherited can vary for individual objects. JavaScript also supports functions without any special declarative requirements.
          Functions can be properties of objects, executing as loosely typed methods.
        </p>




      </section>

      <section class="Hello-world" id="hello4">
        <h2 class="section-title">Hello World</h2>
        <p class="content">
          To get started with writing JavaScript, open the Scratchpad and write your first "Hello world" JavaScript code:
        </p>
        <code>
                    function greetMe(yourName) { alert("Hello " + yourName); }
                    greetMe("World");
                </code>

        <p class="content">
          Select the code in the pad and hit Ctrl+R to watch it unfold in your browser!
        </p>

      </section>

      <section class="Variables" id="var5">
        <h2 class="section-title">Variables</h2>
        <p class="content">
          You use variables as symbolic names for values in your application. The names of variables, called identifiers, conform to certain rules. A JavaScript identifier must start with a letter, underscore (_), or dollar sign ($); subsequent characters can also
          be digits (0-9). Because JavaScript is case sensitive, letters include the characters "A" through "Z" (uppercase) and the characters "a" through "z" (lowercase). You can use ISO 8859-1 or Unicode letters such as å and ü in identifiers. You can
          also use the Unicode escape sequences as characters in identifiers. Some examples of legal names are Number_hits, temp99, and _name.
        </p>

      </section>

      <section class="Declaring-variables" id="decl6">
        <h2 class="section-title">Declaring variables</h2>
        <p class="content">
          JavaScript and Java are similar in some ways but fundamentally different in some others. The JavaScript language resembles Java but does not have Java's static typing and strong type checking. JavaScript follows most Java expression syntax, naming conventions
          and basic control-flow constructs which was the reason why it was renamed from LiveScript to JavaScript.
        </p>

        <p class="content">
          In contrast to Java's compile-time system of classes built by declarations, JavaScript supports a runtime system based on a small number of data types representing numeric, Boolean, and string values. JavaScript has a prototype-based object model instead
          of the more common class-based object model. The prototype-based model provides dynamic inheritance; that is, what is inherited can vary for individual objects. JavaScript also supports functions without any special declarative requirements.
          Functions can be properties of objects, executing as loosely typed methods.
        </p>
      </section>

      <section class="Variable-scope" id="var6">
        <h2 class="section-title">Variable-scope</h2>
        <p class="content">
          JavaScript and Java are similar in some ways but fundamentally different in some others. The JavaScript language resembles Java but does not have Java's static typing and strong type checking. JavaScript follows most Java expression syntax, naming conventions
          and basic control-flow constructs which was the reason why it was renamed from LiveScript to JavaScript.
        </p>

        <p class="content">
          In contrast to Java's compile-time system of classes built by declarations, JavaScript supports a runtime system based on a small number of data types representing numeric, Boolean, and string values. JavaScript has a prototype-based object model instead
          of the more common class-based object model. The prototype-based model provides dynamic inheritance; that is, what is inherited can vary for individual objects. JavaScript also supports functions without any special declarative requirements.
          Functions can be properties of objects, executing as loosely typed methods.
        </p>
      </section>

      <section class="Global-variables" id="glob7">
        <h2 class="section-title">Global Variables</h2>
        <p class="content">
          JavaScript and Java are similar in some ways but fundamentally different in some others. The JavaScript language resembles Java but does not have Java's static typing and strong type checking. JavaScript follows most Java expression syntax, naming conventions
          and basic control-flow constructs which was the reason why it was renamed from LiveScript to JavaScript.
        </p>

        <p class="content">
          In contrast to Java's compile-time system of classes built by declarations, JavaScript supports a runtime system based on a small number of data types representing numeric, Boolean, and string values. JavaScript has a prototype-based object model instead
          of the more common class-based object model. The prototype-based model provides dynamic inheritance; that is, what is inherited can vary for individual objects. JavaScript also supports functions without any special declarative requirements.
          Functions can be properties of objects, executing as loosely typed methods.
        </p>
      </section>

      <section class="Constants" id="const8">
        <h2 class="section-title">Constants</h2>
        <p class="content">
          JavaScript and Java are similar in some ways but fundamentally different in some others. The JavaScript language resembles Java but does not have Java's static typing and strong type checking. JavaScript follows most Java expression syntax, naming conventions
          and basic control-flow constructs which was the reason why it was renamed from LiveScript to JavaScript.
        </p>

        <p class="content">
          In contrast to Java's compile-time system of classes built by declarations, JavaScript supports a runtime system based on a small number of data types representing numeric, Boolean, and string values. JavaScript has a prototype-based object model instead
          of the more common class-based object model. The prototype-based model provides dynamic inheritance; that is, what is inherited can vary for individual objects. JavaScript also supports functions without any special declarative requirements.
          Functions can be properties of objects, executing as loosely typed methods.
        </p>
      </section>

      <section class="Data-types" id="data9">
        <h2 class="section-title">Data types</h2>
        <p class="content">
          JavaScript and Java are similar in some ways but fundamentally different in some others. The JavaScript language resembles Java but does not have Java's static typing and strong type checking. JavaScript follows most Java expression syntax, naming conventions
          and basic control-flow constructs which was the reason why it was renamed from LiveScript to JavaScript.
        </p>

        <p class="content">
          In contrast to Java's compile-time system of classes built by declarations, JavaScript supports a runtime system based on a small number of data types representing numeric, Boolean, and string values. JavaScript has a prototype-based object model instead
          of the more common class-based object model. The prototype-based model provides dynamic inheritance; that is, what is inherited can vary for individual objects. JavaScript also supports functions without any special declarative requirements.
          Functions can be properties of objects, executing as loosely typed methods.
        </p>
      </section>
    </main>
  </div>
</body>

</html>

Method 2

Try pin pointing the exact part of the code relating to your questions.

It’s a lot more easier that way!

Method 3

Although i was not able to find the the reason why the nav is 200px aligned top. you can fix it like this.

 .navlink:last-child {
     margin-bottom: 30px;
  }

 .navlink:first-child {
    margin-top: 200px;
 }


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x