Tell us what’s happening:
do you know how to align the code function greetMe(yourName) { alert("Hello " + yourName); }
greetMe(“World”); to the right side of the website
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>
<!-- separated line -->
</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;
border-right:solid;
}
#main-doc header{
text-align: right;
margin:0;
}
header{
display:block;
}
@media only screen and (min-width:600px){
header{
font-size:20px;
}
}
code{
display:block;
float:right;
}
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: