Day 2

index.html for a javascript cheat sheet.  Not finished... only about a third of the way through this one.

**********

<!DOCTYPE html>
<html>
<head>
<!-- Cheatsheet created as a code along with a Traversy Media video on YouTube -->
<!-- https://www.youtube.com/watch?v=vEROU2XtPR8&t=323s -->
<title>JavaScript Cheatsheet</title>
<link rel="stylesheet" type="text/css" href="style.css">

<!--
To connect to an external JavaScript file, use the following code
<script src="main.js"></script>
-->

</head>
<body>
<div class="header">
<h1>Learning JaveScript</h1>
<p>With Brad Traversy</p>
</div>



<div class="container">


</div>

<div>
<!-- Use <script></script> TAGs when not using external JS file -->
<!-- It is best -->
<script>
alert('Script tags work');
</script>
</div>

<!--
variables can contain:
letters, numbers, underscores, and dollar signs

variable names should begin with a letter
although they can begin with either a _(underscore) or $(dollar sign)
variable names are case sensitive (Test is not the same as test)
-->

<!--
camel case
var myFavoriteNumber

partial case
var MyFavoriteNumber

underscore
var my_favorite_number
-->

<script>
// Number
var number1 = 35;
var number2 = 40;
var number3 = '35';
var number4 = '40';

alert(number1 + number2);
alert(number3 + number4);
alert('My favorite number is ' + number1); //cancontanate string and numeric variables

// Array

// String

// Object
</script>

</body>
</html>

**********

style.css

body {
text-align: center;
font-family: sans-serif;
font-size: 18px;
}

li {
list-style: none;
line-height: 2em;
text-align: left;
}

.header {
background: #f4f4f4;
border-bottom: #ccc 3px solid;
padding: 20px;
}
.container {
width: 700px;
margin: 30px auto;
}

Comments

Popular posts from this blog

Day 188

Day 1