Presented by CSUF ACM

Web Development Workshop

HTML Tutorial

What to Expect

  • General Rule
  • Header (Including files, titles, etc)
  • Comments
  • Commonly Used Tags
  • Self-closing tags
  • Lists (ordered & unordered)
  • Attributes

General Rule

<tagname> Hello World </tagname>

These are called tags.

Header

For the beginning of your HTML documents it is good practice to specify the document type with:

<!DOCTYPE html>

In order for the computer to easily identify what type of document it is. You can also enclose all your HTML with an html tag like so,

<html>
<!--Content Here-->
</html>

In addition, developers generally put external stylesheets and other definition tags within header tags like so,

<head>
  <link rel="stylesheet" href="/stylesheet_directory"/><!--You would place your external style file in this tag-->
  <title>Page Homepage</title> <!--Title of the page usually appears on tab-->
</head>

A typical html document would have an outline/template like the one shown below:

<!DOCTYPE html>
<html>
  <head>
    <!--external files or metadata here-->
    <title>Page Title</title><!--Title of the page usually appears on tab-->
  </head>
  <body>
  </body>
</html>

Comments

Comments are an essential part of every coding language for HTML, if you haven’t noticed already look like the example provided below

<!--Hello I am a comment-->

You will use this to describe sections of your code as well as better organize your code!

Commonly Used Tags

You will use these on many HTML document!

Bold

<b> Hello World </b>

<strong> Hello World </strong>

This is with a b tag
This is with a strong tag

Italics

<i> Hello World </i>

This is with a i tag

Underline

<u> Hello World </u>

This is with a u tag

H tag (headers)

These are like all the headers you see on this page. Your headers may look different from this website because you haven’t added styling yet.

<h1> Hello World </h1>
<h2> Hello World </h2>
<h3> Hello World </h3>
<h4> Hello World </h4>
<h5> Hello World </h5>
<!--and so on ...-->

This is with a h1 tag

Paragraph tag

This is used to signify a paragraph.

<p> Hello World </p>

This is with a h1 tag

Self Closing Tags

Self closing tags are tags that do not need a closing tag like the examples above.

Image Tag

This tag allows you to display an image or gif on your page.

<img src="https://imgur.com/qFxJTtS.gif">

Later I’ll show you how to resize this image.

Lists(ordered & unordered)

An unordered list is a bulleted list or any symboled list.

<ul><!--signifies start of unordered list-->
  <li>Hello</li><!--first bullet point-->
  <li>World</li><!--second bullet point-->
</ul><!--signifies end of unordered list-->
  • Hello
  • World

An ordered list is a numbered list.

 <ol><!--signifies start of ordered list-->
   <li>Hello</li><!--first point-->
   <li>World</li><!--second point-->
 </ol><!--signifies end of ordered list-->
 
  1. Hello
  2. World

Attributes

Attributes are modifiers of an HTML element type. There are several types of attributes required, optional, standard, and event. Required attributes are needed by the element in order to function correctly this is the case for tags like the ‘a’ tag. Optional attributes are not needed by the element but can be used to modify the default function like the example below.

‘a’ tags are used for links. The ‘href’ attribute is an example of a required attribute because if it is not included it will just be a regular block of text; the ‘target’ attribute is an optional attribute because it is being used to alter the default ‘_blank’ allows the tag to tell the browser to open the page in a new webpage or tab.

  <a href="https://imgur.com/qFxJTtS.gif" target="_blank">Image</a>

Image

Similarly, with the ‘img’ tag the ‘src’ attribute is required in order for it to show an image. We can also include the optional tags ‘width’ and ‘height’ to change the size of the image

<img src="https://imgur.com/qFxJTtS.gif" width="150px" height="auto">

The auto value allows it to adjust based on the width size

Standard Attributes include ‘id’, ‘class’, ‘style’, ‘title’, etc. These attributes are used to alter the style (or CSS) of the HTML tag which we will discuss later. Event Attributes are inline javascript functions in the HTML which we will also discuss later.


Example

<!DOCTYPE html>
<html>
  <head>
    <title>My Personal Page</title><!--Title of the page usually appears on tab-->
  </head>
  <body>
    <h1>Profile</h1>
    <h2>About Me</h2>
    <p><img src="https://imgur.com/4c6qaOy.gif" height="250px" width="auto"><BR>
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
    <h2>Favorite Stuff</h2>
    <ul>
    <li><b>Food</b> - Ramen</li>
    <li><b>Drink</b> - Juice</li>
    <li><b>Color</b> - Black, Purple, Green, every color!</li>
    <li><b>Animal</b> - Dog</li>
    </ul>
    <h2>Social Links</h2>
    <ul>
    <li><a href="https://github.com" target="_blank">Github</a></li>
    <li><a href="https://www.linkedin.com" target="_blank">Linkedin</a></li>
    <li><a href="https://facebook.com" target="_blank">Facebook</a></li>
    </ul>
  </body>
</html>

yields

Note:

<BR>

is next line


Try for Yourself!

Create an HTML document with all the following:

  • Title the page with your name in the title tags
  • Create a list of links to popular search engines
  • Create an ordered list of your preferred search engine by rank
  • Create another list that labels your favorite food, drink, color and animal
  • Place the CSUF logo onto the page with size 150px by 150px
  • Create another list that uses the commonly used tags bold, italics, underline, and bold/italic

Make sure to use headers to divide each of these activities on a single HTML page and use the template given above.

On to CSS


References

CSS Tutorial

What to Expect

  • General Rule
  • Comments
  • Where can we write styles?
  • <link> tag
  • Colors
  • Classes
  • IDs
  • Background stuff
  • Properties and Box Model

The CSS Zen Garden demonstrates the power of CSS along with HTML. All this can be done without the usage of Javascript. In this tutorial, I won’t teach you how to do animations but we’ll be learning necessary information that lead up to animation if you’re interested.

General Rule

selector{
  property: value;
  property2: value2;
}

Comments

Comments are similar to how you create comments in C++/C

/* This is a comment */

Where can we write styles?

There are several places where you can write styles. You can create a style tag in the head area of an HTML document like so,

<!DOCTYPE html>
<html>
  <head>
    <title>Home Page</title>
    <style type="text/css">
      selector{
        property: value;
        property2: value2;
      }
    </style>
  </head>
  <body>
  </body>
</html>

You can also do inline styling

<p style="color:pink">pink colored text</p>

You can also place them in a CSS file where you will create a list of

selector{
  property: value;
  property2: value2;
}

selector2{
  property: value;
  property2: value2;
}

Out of the three methods it is common convention to just use the last one. Only use the first two for testing purposes.

Link Tag

The link tag is used to reference an external CSS stylesheet.

<!DOCTYPE html>
<html>
  <head>
    <title>Home Page</title>
    <link rel="stylesheet" type="text/css" href="style.css">
  </head>
  <body>
  </body>
</html>

The ‘href’ attribute value in this example would assume the style.css file is in the same directory as the HTML file. This is the recommended way to include style into your HTML document.

Colors

When styling your documents there are multiple ways to refer to colors by name, hex code, and rgb.

There are several color names prebuilt into every browser. If you’re interested they’re all listed here. You can use these colors like in the example below:

In the CSS file, style.css

h3 {
  color:navy;
}

In the HTML file,

<!DOCTYPE html>
<html>
<head>
  <title>Home Page</title>
  <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h3>I am Navy Blue by name.</h3>
<h3 style="color:navy">I am Navy Blue by name.</h3><!--NOT RECOMMENDED inline styling-->
</body>
</html>

I am Navy Blue by name.

Another very common and professional way of adding colors is through hex codes. There are many color picking sites online with a simple google search (I usually just search “hex codes”) that let you get the hex code color you need.

In the CSS file, style.css

h3 {
  color:#000080; /* I'm still navy */
}

In the HTML file,

<!DOCTYPE html>
<html>
<head>
  <title>Home Page</title>
  <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h3>I am Navy Blue by hex code.</h3>
<h3 style="color:#000080">I am Navy Blue by hex code.</h3><!--NOT RECOMMENDED inline styling-->
</body>
</html>

I am Navy Blue by hex code.

Another alternative that are the rgb values. You can find these values on the same color picking sites as the hex codes. The first value indicates the amount of red the color has, the next how much green and the next how much blue.

In the CSS file, style.css

h3 {
  color:rgb(0, 0, 128); /* I'm still navy */
}

In the HTML file,

<!DOCTYPE html>
<html>
<head>
  <title>Home Page</title>
  <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h3>I am Navy Blue by rgb.</h3>
<h3 style="color:rgb(0, 0, 128)">I am Navy Blue by rgb.</h3> <!--NOT RECOMMENDED inline styling-->
</body>
</html>

I am Navy Blue by rgb.

IDs

ID selectors can only be used on one HTML tag per page, thus unique. The selectors name is preceded by a ‘#’

In the CSS file, style.css

#favorite{
  color:red;
}

In the HTML file,

<!DOCTYPE html>
<html>
<head>
  <title>Home Page</title>
  <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
  <h2>Colors</h2>
  <ul>
  <li>Red</li>
  <li>Orange</li>
  <li>Yellow</li>
  <li>Green</li>
  <li id="favorite">Blue</li>
  <li>Purple</li>
  </ul>
</body>
</html>

Classes

Class selectors can be used on multiple HTML tags, thus not unique. The selectors name is preceded by a ‘.’

In the CSS file, style.css

.rgb{
  color:red;
}

In the HTML file,

<!DOCTYPE html>
<html>
<head>
  <title>Home Page</title>
  <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
  <h2>Colors</h2>
  <ul>
  <li class="rgb">Red</li>
  <li>Orange</li>
  <li>Yellow</li>
  <li class="rgb">Green</li>
  <li class="rgb">Blue</li>
  <li>Purple</li>
  </ul>
</body>
</html>

Background Stuff

Another important aspect of CSS involves the background capabilities. Generally, if you want to define the background color of any a tag in HTML you would use the ‘background’ property.

In the CSS file, style.css

body {
  background: #d9ffb3;
}

div {
  background: #73e600;
}

p {
  background: #336600;
  color: #fff;
}

In the HTML file,

<!DOCTYPE html>
<html>
<head>
  <title>Home Page</title>
  <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div>
I am a green text box
<p> with greener p text</p>
</div>
</body>
</html>

The body tag with the background property changed makes the entire page light greenish. The div tag will create a darker green text box. The p tag will create an even darker green background for text enclosed in a p tag. The p tag text is also colored white.

Properties and Box Model

Here is a nice list of CSS Properties and what they do

Box Model

Content is where all the text, images and other stuff you included in the box go. Padding is used to move content away from the edge of the box Borders if included surround the content and padding Margins are used to move content away from things outside of the box

Padding

When you are using the padding property the order of values is top, right, bottom, left.

padding: top, right, bottom, left;

If you place one value it is equivalent to setting all values (top, right, bottom and left) to that value.

padding: 5px;
padding: 5px, 5px, 5px, 5px;

Example

The html document

<!DOCTYPE html>
<html>
  <head>
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,300italic,400italic" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="css/style.css"/><!--CSS Stylesheet-->
    <title>My Personal Page</title><!--Title of the page usually appears on tab-->
  </head>
  <body>
  <header>
    <h1>Profile</h1>
  </header>
  <div id="main" class="container">
      <h3>About Me</h3>
      <p><img src="https://imgur.com/4c6qaOy.gif" height="250px" width="auto"><BR>
      "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."</p>
      <h3>Favorite Stuff</h3>
      <ul>
      <li><b>Food</b> - Ramen</li>
      <li><b>Drink</b> - Juice</li>
      <li><b>Color</b> - Black, Purple, Green, every color!</li>
      <li><b>Animal</b> - Dog</li>
      </ul>
      <h3>Social Links</h3>
      <ul>
      <li><a href="https://github.com" target="_blank">Github</a></li>
      <li><a href="https://www.linkedin.com" target="_blank">Linkedin</a></li>
      <li><a href="https://facebook.com" target="_blank">Facebook</a></li>
      </ul>
    </div>
  </body>
</html>

The CSS file

html
{
  margin: 0;
  padding: 0;
}
body{
  font-family: 'Source Sans Pro', san-serif;
  margin: 0;
  padding: 0;
  background: #f0f0f0;
}

header{
  width: 100%;
  background-color: #ffffff;
  margin: 0px 0px 10px 0px;
  padding: 0;
  top:0;
  text-align: center;
}

h1 {
  font-size: 50px;

}

.container {
  margin-left: 20%;
  margin-right: 20%;

}

#main {
  box-shadow: 2px 2px 2px 1px rgba(0, 0, 0, .2);
  background-color: #fff;
  height: 100%;
  padding: 10px;
}

yields


Try for Yourself!

Create a CSS document that styles the HTML page you created in the previous tutorial with all the following:

  • Have all the ‘li’ tags be red.
  • Have all the h1 tags be a hex code color selected from here.
  • Create an index called favorite and set the color property to be your favorite color selected from here.
  • Create a class called useful and set the color property to be any color selected from here.
  • Set an ‘li’ item from your favorites section to have an id favorite.
  • Set ‘li’ items bold, italic, and underline with class useful.

Back to HTML On To Javascript


References

Javascript Tutorial

What to Expect

  • Variables
  • Comments
  • Boolean Logic
  • Loops
  • Function
  • Arrays
  • Where can we write scripts?
  • JQuery

A lot of this should be review from your Intro to Programming courses 120, 121, and 131 except in a different language. Even though Javascript looks different from C++, logically it should be the same. So, I will briefly go over these concepts in this tutorial.

Variables

There are 5 primitive data types. They are all stored in a var object. So rather than doing

int number;
string word;
bool truth;

You would do

var number = 55;
var word = "word";
var word = 32.5; //changes it to a number
var truth = True;

The language is similar to python in that you can also like in the example above reassign variables with a completely different type. Similarly to every other language you can use any of the I think at this point you would be wondering what the other two data types are they are undefined and null. Later I will discuss their usage.

With numbers you can use all the operators you are used to in C++, like %, /, *, +, and -

var number = 4; //number = 4
number += 2.5; //number = 6.5
number = 10%3; //number = 1

Similarly, strings manipulation is like C++

var hello = "hello world"; //double
var hi = 'hello world'; //and single quotes work
var test = "hello" + "world"; // you can combine 2 strings
var length = test.length;
var character = test[1]; //'e'

"hey"[1]; // "e"
"hello there".length // 11

Variables that are decalared but not initialized are labeled undefined. Whereas, variables have to be assigned ‘null’ to be ‘explicitly nothing’.

var iamnothing; //is undefined
iamnothing = null; //defined with null/nothing

Comments

If you haven’t noticed already comments are similar to that of C++

//I am a comment
/*
Hey,
I am a multiline comment!
*/

Boolean Logic

Here is a table of comparison operators. Most of them are also very similar to C++

Assume x = 5

Operator Name Example Result
> Greater Than x > 10 false
>= Greater Than or Equal to x >= 5 true
< Less Than x < -50 false
<= Less Than or Equal to x <= 100 true
== Equal to x == ‘5’ true
!= Not Equal to x != “b” true
=== Equal value and type x === “5” false
!== Not equal value or type x !== “5” true

The last two operators are important since all variables are loosely typed. Each variable does not have a set type. That is why in javascript

5 == “5”

is true but

5 === “5”

is not.

Here is a table of logical operators. All of them should be familiar from C++

Assume x = 5 and y = 9

Operator Name Example Result
&& AND x < 10 && x !== 5 false
OR y > 9 ∥ x == 5 true
! NOT !(x == y) true

Loops

While loops Very similar to C++

while(condition){
  //repeat code
}

For loops Very similar to C++

for(initialize; condition; step){
  //repeat code
}

Functions

The primary difference between C++ and Javascript is the lack of return type.

function functionName(argument list){
  //some code
}

You can still return values in javascript even without the return type.

function functionName(argument list){
  //some code
  return "";
}

Arrays

Probably the only data structure you would use in Javascript.

Function What it does What does it return?
push(value) adds “value” element to end of array N/A
pop() removes last element in the array element removed
unshift(value) adds “value” element to front of array N/A
shift() removes first element in the array element removed
indexOf(value) returns the value of the desired element or -1 if it does not exist index of desired element; or -1 if does not exist
slice(start, end) returns elements from the start and end point specified of an array elements from the start and end point specified of an array
splice(start, end) removes elements from the start and end point specified of an array elements from the start and end point specified of an array

Here is a demo of some commonly used functions

var numbers = ["1", "2", "3"];
numbers.push("4");
//numbers = ["1", "2", "3", "4"]

numbers.pop();
//numbers = ["1", "2", "3"];

var value = numbers.pop(); //returns the removed value
//value = "3"
//numbers = ["1", "2"];

numbers.unshift("0"); //adds 0 to the front of the array
//numbers = ["0", "1", "2"]

numbers.shift();
//numbers = ["1", "2"]

value = numbers.shift(); //returns the removed value
//value = "1";
//numbers = ["2"]

numbers.unshift("1"); //adds 0 to the front of the array
//numbers = ["1", "2"]

numbers.push("3");
//numbers = ["1", "2", "3"]

numbers.push("4");
//numbers = ["1", "2", "3", "4"]


numbers.indexOf("1"); //0
numbers.indexOf("6"); //-1

var range = numbers.slice(1,3);
//range = ["2", "3"];

var all = numbers.slice();
//all = ["1", "2", "3", "4"];

//Both do not alter the original array (numbers)!

numbers.splice(1,1); //will remove the 2nd element
//numbers = ["1", "3", "4"];

Iterating

There are two ways to iterate through an array.

For Loop

Iterates through specified number of elements in an array.

var numbers = ["1", "2", "3"];
for(var i = 0; i < numbers.length; i++){
  console.log(numbers[i]); // prints each element of the array
}

ForEach Loop

Iterates through each element of the array.

var numbers = ["1", "2", "3"];
numbers.forEach(function(number){
    console.log(number); //prints each element in the array
  });

Where can we write scripts?

There are several places where you can write scripts. You can create a script tag in the head area of an HTML document like so,

<!DOCTYPE html>
<html>
  <head>
  <script type="text/javascript">
    console.log("hello world");
  </script>
    <title>Home Page</title>
  </head>
  <body>
  </body>
</html>

or (better)

<!DOCTYPE html>
<html>
  <head>
    <title>Home Page</title>
  </head>
  <body>
  </body>
  <script type="text/javascript">
    console.log("hello world");
  </script>
</html>

You can also do inline scripting as well which is not recommended

<p onclick="alert('hey! notice me!')">pink colored text</p>

You can also place them in a Javascript file where you can create multiple functions you want the page to execute

var num = document.getElementById("number1").value;
var nums = document.getElementById("number2").value;
document.getElementById("alter").innerHTML = "The sum of the numbers is "+add(num, nums);
document.getElementById("alter2").innerHTML = "The difference of the numbers is "+subtract(num, nums);


function add(num1, num2){
  return num1+num2;
}

function subtract(num1, num2){
  return num1-num2;
}

Out of the three methods it is common convention to just use the last one. Only use the first two for testing purposes. It is recommended you place all script tags at the bottom of the HTML file so right after the body tag, since the browser loads all the information by line order. If you are using javascript to alter your HTML, it won’t be able to change what it doesn’t know yet.

JQuery

Jquery is a popular javascript library that quickens and simplifies javascript code. If you’re interested in using it here is the JQuery Documentation Here are a few examples:

document.getElementById("favorite");
document.getElementsByClassName("useful");

versus

$("#favorite"); //document.getElementById("favorite");
$(".useful"); //document.getElementsByClassName("useful");

How do I include JQuery?

We use either a Content Delivery Network or CDN for short which is a link online that serves content which in this case is the script file. Programmers generally use a CDN because users usually already have the CDN file link downloaded. Otherwise if your server is quick enough you can host the JQuery file locally by simply downloading the script file from their website. Make sure the JQuery file is included before your Javascript files or script tags.


Example

The html document

<!DOCTYPE html>
<!DOCTYPE html>
<html>
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!--Jquery CDN-->
    <link rel="stylesheet" href="css/style2.css"/>
    <title>Javascript Demo</title><!--Title of the page usually appears on tab-->
  </head>
  <body>
      <img class="fade" src="https://i.imgur.com/6WrnLjg.jpg" height="100">
      <img class="fade" src="https://i.imgur.com/BEzTVoj.jpg" height="100">
      <img class="fade" src="https://i.imgur.com/ihSqFXz.png" height="100">
      <img class="slide" src="https://i.imgur.com/aWmKefJ.jpg" height="100">
      <img class="slide" src="https://i.imgur.com/CA54uGd.jpg" height="100">
      <img class="slide" src="https://i.imgur.com/Z9dJKqw.jpg" height="100">
      <div class="test">Click me!</div>
      <BR><BR>
      <button id="clickable">Click to Fade</button>
      <button class="clickable2">Click to Fade</button>
      Click this box and press some keys
      <div id="play"></div>
  </body>
  <script src="js/script.js"></script>
</html>
.test {
    color: #000;
    padding: .5em;
    width: 50%;
  }
.inside {
  background-color: black;
  color: white;
}
.active {
  color: #900;
}

The Javascript file

var button = document.getElementById("clickable");

$("#clickable").click(function() {
  $(".fade").fadeToggle("slow", "linear");
});

$(document).keyup(function(event) {
  if(event.keyCode == 68 || event.keyCode == 117) //Play around with your keys to see what keys activate the slide
    $(".slide").slideUp("slow");
  if(event.keyCode == 85 || event.keyCode == 100)
    $(".slide").slideDown("slow");
});

$(document).keypress(function(event) {
  document.getElementById("play").innerHTML += "<BR>You have pressed key "+ event.key;
});

//Recommended way
$(".clickable2").on( "click" ,function() {
  $(".fade").fadeToggle("slow", "linear");
});

$( "div.test" ).on({
  click: function() {
    $( this ).toggleClass( "active" );
  }, mouseenter: function() {
    $( this ).addClass( "inside" );
  }, mouseleave: function() {
    $( this ).removeClass( "inside" );
  }
});

Check it out here!


Try it for Yourself

Create a Javascript, CSS, and HTML document that implement the following:

  • Include JQuery with a CDN
  • Create a list of words starting with different letters of the alphabet (26 words)
  • Create a button that toggles the slide feature with the vowel items items in a list
  • Create a button that toggles the fade feature with consonant items in a list
  • Create a div that shows the number of times the vowel and consonant button was pressed
  • Have the created div have the same mouseleave, mouseenter, and click effect the example does

Back to CSS


References

Personal Page Template Guide/Links

Introduction

Hello, this is a short tutorial to make a quick personal website with limited knowledge on web development. You can use any of the template links below to create your website. Depending on the type of website you choose I will have a guide on how to create your own personal website on github! I put stars () near the ones that I recommend for you guys to use.


HTML/CSS/Javascript Template Websites

There’s more than just this list you can just google search for free website templates online as well. A lot of the information on how to use these should be pretty straight forward however if you have any questions you can contact me anytime with the contact information listed at the footer.


Jekyll Template Websites

You can find tons of websites online with a simple google search for jekyll themes.


Not sure which to use?

Do you plan on blogging? Go with Jekyll

Are you a beginner at Web Development? Go with HTML/CSS/Javascript

So now that you have picked your desired template/theme please follow the links below to lead you to a tutorial on how to set it up!
HTML/CSS/Javascript Template Websites
Jekyll Template Websites

HTML/CSS/Javascript Personal Site Guide

Before you start

Please pick one of the following templates before you start this tutorial:

Once you have successfully downloaded the template of your choice please follow the directions below.


Setting up

Once you have downloaded/saved your website template, it will show up in wherever you set up your download folder.

Go to that folder and open the main/homepage/index html file in any text editor of your choice (I recommend Atom or Sublime)

In example, mine is labeled index.html. If it is not named index.html please change it to index.html since github recognizes the homepage link as index.html like this

You can also see how you are editing your site in realtime by opening the HTML document in your browser and refreshing the page.

like this

You can debug your site by right-clicking (if you are on Windows/Linux) or control+click (if you are on a Mac) and selecting the “Inspect Elements” option which should come with every browser.

like this

If you would like a guide on understanding HTML, I am currently creating one but you can also refer to other sources online. You should not have to alter any of the CSS or Javascript with these templates.


Deploying to Github

Create a repository named .github.io without the '<>'

In this tutorial, my username is nvurdienn so my repository would be named nvurdienn.github.io

like this

Once you have done that set up Git on your computer, if you haven’t already. If you have a Mac/Linux, Git should be preinstalled on your system; however, if you have windows you should download Github Desktop. Instructions on how to set up Git through command line are listed here. Linux/Mac users may also set up Git by downloading and logging into Github Desktop.

Once you have logged into Git, add all the files into that repository.

First, you will need to clone your repository to your computer. Then move into that directory with the “cd” command

git clone <yourgithubclonelink>
cd <insertGithubUserNameHere>.github.io

Open the folder that contained all the website files and copy them over to your repository folder. Then type the following commands

git add .
git commit -m "<Any commit message here>"
git push

like this

Congrats you have successfully created your personal page!

The page would be at .github.io

As an example, the username used in this tutorial would be nvurdienn.github.io

You can continuously edit this repository by using the last three commands listed above just make sure you are in the correct directory. Make sure you save all files before trying to push them to github. Also, make sure you edit all documents in the folder connected to your github repository.

Jekyll Personal Site Guide

Before you start

Please pick one of the following templates before you start this tutorial:

Once you have successfully downloaded the template of your choice please follow the directions below.


Setting up

Once you have downloaded/saved your website template, it will show up in wherever you set up your download folder.

Go to that folder and open the main/homepage/index html file in any text editor of your choice (I recommend Atom or Sublime)

In example, mine is labeled index.html. If it is not named index.html please change it to index.html since github recognizes the homepage link as index.html like this

You probably won’t have to change ANY HTML in your Jekyll template!

But if you do, you can see how you are editing your site in realtime by opening the HTML document in your browser and refreshing the page like this.

You can debug your site by right-clicking (if you are on Windows/Linux) or control+click (if you are on a Mac) and selecting the “Inspect Elements” option which should come with every browser. like this

Also please note for Jekyll, if you plan on managing a blog many of the templates will include a _posts folder where you can create .md files to create new posts. The templates will have the same structure as the sample .md file given in the folder. Also every Jekyll file will be set up differently and generally in all the “README.md” files in the home directory will contain set up instructions. The _config.yml file should be filled out with your information!

If you are using a template for Jekyll and you are new to web development, please only edit the .md files and the _config.yml file in order to prevent any unwanted effects!!

Many of the pages you will be using will be using Markdown so here is an excellent resource on getting started with that is this Markdown-Cheatsheet on Github. Markdown also works with HTML so if you would like a guide on understanding HTML, I am currently creating one but you can also refer to other sources online. You should not have to alter any of the CSS or Javascript with these templates.


Deploying to Github

Create a repository named .github.io without the '<>'

In this tutorial, my username is nvurdienn so my repository would be named nvurdienn.github.io

like this

Once you have done that set up Git on your computer, if you haven’t already. If you have a Mac/Linux, Git should be preinstalled on your system; however, if you have windows you should download Github Desktop. Instructions on how to set up Git through command line are listed here. Linux/Mac users may also set up Git by downloading and logging into Github Desktop.

Once you have logged into Git, add all the files into that repository.

First, you will need to clone your repository to your computer. Then move into that directory with the “cd” command

git clone <yourgithubclonelink>
cd <insertGithubUserNameHere>.github.io

Open the folder that contained all the website files and copy them over to your repository folder. Then type the following commands

git add .
git commit -m "<Any commit message here>"
git push

like this

Congrats you have successfully created your personal page!

The page would be at .github.io

As an example, the username used in this tutorial would be nvurdienn.github.io

You can continuously edit this repository by using the last three commands listed above just make sure you are in the correct directory. Make sure you save all files before trying to push them to github. Also, make sure you edit all documents in the folder connected to your github repository.