Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                

<!DOCTYPE html>
<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
		<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
  
  <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>

		<!-- jQuery and JS bundle w/ Popper.js -->
		<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
		<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>

           <link rel="stylesheet" type="text/css" href="style.css">
       
                   <title> Technical Pages</title>
     </head>
	
      
         <body class="fluid-container">

            <div class="row" id="top-head">
              <div class="col-12">
                 <header id="title">
                   <p id="title-text">For Java Lovers</p> 
               </header>
              </div>
            </div>


            <div class="row">
            	 <div class="col-md-3" id="nav-div">  
         <nav id="navbar">
       <header id="nav-head">Java Documentation</header>
       <ul>
       <li> <a  class="nav-link" href="#what_is_java">WHAT IS JAVA</a></li>
 <li> <a  class="nav-link" href="#GET_STARTED">GET STARTED</a></li>
       <li> <a  class="nav-link" href="#java_syntax">JAVA SYNTAX</a></li>
       <li> <a  class="nav-link" href="#comments">COMMENTS</a></li>
       <li> <a  class="nav-link" href="#variables">Variables</a></li>
       </ul>

   </nav>
     </div>

       <div class="col-md-9">   
       <main id="main-doc"  class="container">
        <section class="main-section" id="what_is_java">
            <header><h1>what is java</h1></header>
             <article>
                <p>
                Java is a popular programming language, created in 1995.
                </p>
                <p> It is owned by Oracle, and more than 3 billion devices run Java.</p>
                <p>
                It is used for:
                  <ul>
                    <li>Mobile applications (specially Android apps)</li>
                    <li> Desktop applications </li>
                    <li> Web applications</li>
                    <li> Web servers and application servers</li>
                    <li> Games</li>
                    <li> Database connection</li>
                    <li> And much, much more!</li>

                  </ul>
                </p>
             </article>
        </section>
          
          <section class="main-section" id="GET_STARTED">
          
            <header><h1>GET STARTED</h1></header>
            <article>
                <h2> Java Install</h2>
                <p>
                    Some PCs might have Java already installed.
                </p>
                <p>
                    To check if you have Java installed on a Windows PC, search in the start bar for Java or type the following in Command Prompt (cmd.exe)
                </p>
                <p>
                    If you do not have Java installed on your computer, you can download it for free at <a href="https://www.oracle.com/java/technologies/java-se-glance.html" target="_blank">oracle.com.</a> 
                </p>
                <p>
                    <b>Note:</b> In this tutorial, we will write Java code in a text editor. However, it is possible to write Java in an Integrated Development Environment, such as IntelliJ IDEA, Netbeans or Eclipse, which are particularly useful when managing larger collections of Java files.
                </p>
            </article>
      
          </section>

            <section class="main-section"  id="java_syntax">
            <header> <h1>Java Syntax</h1></header>
            <article>
                
                <p>
                    In the previous chapter, we created a Java file called MyClass.java, and we used the following code to print "Hello World" to the screen:
                </p>
                <p>
                    <img src="https://cdn.journaldev.com/wp-content/uploads/2016/08/public-static-void-main-string-args.png">
                </p>
                <p>
                    Every line of code that runs in Java must be inside a class. In our example, we named the <b>class</b>
                </p>
                <p>
                    <b>MyClass.</b> A class should always start with an uppercase first letter.
                </p>
                <p>
                    <b>Note:</b>Java is case-sensitive: "MyClass" and "myclass" has different meaning.
                </p>
                           <code>
                            public class MyClass { <br>
                                  int x = 5;<br>
                                         }<br>
                           </code>
                       <br>
                           <code>
                            public class MyClass {<br>
                                   int x = 5;<br><br>

                      public static void main(String[] args) {<br>
                      MyClass myObj = new MyClass();<br>
                      System.out.println(myObj.x);<br>
                           }<br>
                         }<br>
                           </code> <br> 
               <code>
                            public class MyClass {<br>
                                   int x = 5;<br><br>

                      public static void main(String[] args) {<br>
                      MyClass myObj = new MyClass();<br>
                      System.out.println(myObj.x);<br>
                           }<br>
                         }<br>
                           </code> <br> 
              
            </article>
            
          </section>


           <section class="main-section"  id="comments">
            <header><h1>Comments</h1></header>
                 <p>
                    Comments can be used to explain Java code, and to make it more readable. It can also be used to prevent execution when testing alternative code.
                 </p>
                 <p>
                    Single-line comments start with two forward slashes (//).
                 </p>
                 <p>
                    Any text between // and the end of the line is ignored by Java (will not be executed).
                 </p>

                     <p>
                        This example uses a single-line comment before a line of code:
                     </p>
                     <p>
                        <img src="https://i2.wp.com/francescolelli.info/wp-content/uploads/2019/08/CommentsInYourCode.png?fit=1101%2C395&ssl=1">
                     </p>
                     <code>
                        // This is a comment <br>
                     </code> <br> 
                  <code>
                    /* The code below will print the words Hello World <br>
                       to the screen, and it is amazing */
                  </code> <br> <br>
                        

           </section>

           <section class="main-section"  id="variables">
               <header><h1>Variables</h1></header>
                   <p>
                    Variables are containers for storing data values.
                   </p>
                    <p>
                        In Java, there are different <b>types</b> of variables, for example:
                    </p>
                    <p>
                        <ul>
                            <li>String - stores text, such as "Hello". String values are surrounded by double quotes</li>
                            <li>int - stores integers (whole numbers), without decimals, such as 123 or -123</li>
                            <li>float - stores floating point numbers, with decimals, such as 19.99 or -19.99</li>
                            <li>char - stores single characters, such as 'a' or 'B'. Char values are surrounded by single quotes</li>
                            <li>
                                boolean - stores values with two states: true or false
                            </li>
                        </ul>
                </p>
           </section>

</main>
</div>
      
</div>

</body>
</html>


              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Courgette&family=Shadows+Into+Light&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Courgette&family=Itim&family=Shadows+Into+Light&display=swap');

body{
	background-color: #D0D8E7;
  
}

h1 ,h2 {
  font-family: 'Itim', cursive;
}
  img{
  	 width: 80%;
  }

 /* start of the header*/
#top-head{
	height: 100px;
  background-color: #eec0c6;
   background-image: linear-gradient(315deg, #eec0c6 0%, #7ee8fa 74%);
}
#title{
	padding-top: 30px;
	text-align: center;
	font-family:'Courgette', cursive;
	font-weight: bolder;
	font-size: 30px;
}
/*  end of the header*/
  
    /*nav starts heare*/
#nav-div{
	border-radius:10px;
	background-color: #BBCAE8;
	
}
 #navbar{
 	position: fixed;
 }
#nav-head{
	text-align: center;
   padding: 10px;
   font-family:'Courgette', cursive;
   font-weight: bolder;
   font-size: 20px;
}

nav ul li{
	list-style: none;
	border-bottom: 1px solid white;
}
  /*nav ends here*/


.main-section{
	background-color: #EDF6BB;
	margin: 10px;
	padding: 10px;
	border-radius: 10px;
}

code{
	color:black;
	font-size: 15px;
}

@media only screen and (max-width: 768px) {
  .content, nav {
    flex: 0 0 100%;
    background-color: #BBCAE8;
   }
   .row {
      flex-wrap: wrap-reverse; 
      flex-direction: column-reverse;
   }
 


              
            
!

JS

              
                // !! IMPORTANT README:

// You may add additional external JS and CSS as needed to complete the project, however the current external resource MUST remain in place for the tests to work. BABEL must also be left in place. 

/***********
INSTRUCTIONS:
  - Select the project you would 
    like to complete from the dropdown 
    menu.
  - Click the "RUN TESTS" button to
    run the tests against the blank 
    pen.
  - Click the "TESTS" button to see 
    the individual test cases. 
    (should all be failing at first)
  - Start coding! As you fulfill each
    test case, you will see them go   
    from red to green.
  - As you start to build out your 
    project, when tests are failing, 
    you should get helpful errors 
    along the way!
    ************/

// PLEASE NOTE: Adding global style rules using the * selector, or by adding rules to body {..} or html {..}, or to all elements within body or html, i.e. h1 {..}, has the potential to pollute the test suite's CSS. Try adding: * { color: red }, for a quick example!

// Once you have read the above messages, you can delete all comments. 

              
            
!
999px

Console