diff --git a/css/main.css b/css/main.css index ebd0ebd..4b06749 100644 --- a/css/main.css +++ b/css/main.css @@ -10,7 +10,7 @@ Base styles: opinionated defaults ========================================================================== */ -html { + html { color: #222; font-size: 1em; line-height: 1.4; @@ -24,7 +24,7 @@ html { * Customize the background color to match your design. */ -::-moz-selection { + ::-moz-selection { background: #b3d4fc; text-shadow: none; } @@ -38,7 +38,7 @@ html { * A better looking default horizontal rule */ -hr { + hr { display: block; height: 1px; border: 0; @@ -53,12 +53,12 @@ hr { * https://github.com/h5bp/html5-boilerplate/issues/440 */ -audio, -canvas, -iframe, -img, -svg, -video { + audio, + canvas, + iframe, + img, + svg, + video { vertical-align: middle; } @@ -66,7 +66,7 @@ video { * Remove default fieldset styles. */ -fieldset { + fieldset { border: 0; margin: 0; padding: 0; @@ -76,7 +76,7 @@ fieldset { * Allow only vertical resizing of textareas. */ -textarea { + textarea { resize: vertical; } @@ -84,7 +84,7 @@ textarea { Browser Upgrade Prompt ========================================================================== */ -.browserupgrade { + .browserupgrade { margin: 0.2em 0; background: #ccc; color: #000; @@ -95,7 +95,10 @@ textarea { Author's custom styles ========================================================================== */ - + .class1 { + background-color:red; + height: 20vh; + } @@ -119,7 +122,7 @@ textarea { * Hide visually and from screen readers */ -.hidden { + .hidden { display: none !important; } @@ -128,7 +131,7 @@ textarea { * http://snook.ca/archives/html_and_css/hiding-content-for-accessibility */ -.visuallyhidden { + .visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; @@ -145,8 +148,8 @@ textarea { * https://www.drupal.org/node/897638 */ -.visuallyhidden.focusable:active, -.visuallyhidden.focusable:focus { + .visuallyhidden.focusable:active, + .visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; @@ -159,7 +162,7 @@ textarea { * Hide visually and from screen readers, but maintain layout */ -.invisible { + .invisible { visibility: hidden; } @@ -175,8 +178,8 @@ textarea { * `:before` to contain the top-margins of child elements. */ -.clearfix:before, -.clearfix:after { + .clearfix:before, + .clearfix:after { content: " "; /* 1 */ display: table; /* 2 */ } @@ -191,14 +194,14 @@ textarea { Modify as content requires. ========================================================================== */ -@media only screen and (min-width: 35em) { + @media only screen and (min-width: 35em) { /* Style adjustments for viewports that meet the condition */ } @media print, - (-webkit-min-device-pixel-ratio: 1.25), - (min-resolution: 1.25dppx), - (min-resolution: 120dpi) { +(-webkit-min-device-pixel-ratio: 1.25), +(min-resolution: 1.25dppx), +(min-resolution: 120dpi) { /* Style adjustments for high resolution devices */ } @@ -208,7 +211,7 @@ textarea { http://www.phpied.com/delay-loading-your-print-css/ ========================================================================== */ -@media print { + @media print { *, *:before, *:after, @@ -216,7 +219,7 @@ textarea { *:first-line { background: transparent !important; color: #000 !important; /* Black prints faster: - http://www.sanbeiji.com/archives/953 */ + http://www.sanbeiji.com/archives/953 */ box-shadow: none !important; text-shadow: none !important; } @@ -239,8 +242,8 @@ textarea { * or use the `javascript:` pseudo protocol */ - a[href^="#"]:after, - a[href^="javascript:"]:after { + a[href^="#"]:after, + a[href^="javascript:"]:after { content: ""; } @@ -255,7 +258,7 @@ textarea { * http://css-discuss.incutio.com/wiki/Printing_Tables */ - thead { + thead { display: table-header-group; } diff --git a/index.html b/index.html index b22fb35..24550df 100644 --- a/index.html +++ b/index.html @@ -1,40 +1,46 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - -

Hello world! This is HTML5 Boilerplate.

- - - - - - - - - - + + + +

+ +

+ +
+ +
+ + + + + + + + + + diff --git a/js/main.js b/js/main.js index e69de29..b6bac9f 100644 --- a/js/main.js +++ b/js/main.js @@ -0,0 +1,43 @@ +/* 1) +Write a function that calcuates and RETURNS the product of two +numbers. I should be able to use the function like the code below: +*/ +function getProduct(num1, num2) { + result = num1 * num2 + return result +} + +var prod = getProduct(5,8); +console.log(prod+5); + +/* 2) +Write a Javascript function that takes TWO parameters: element and class. +The element should be a DOM object, NOT a string. The class can be a string. +The function should add the designated class to the element. The code below should work */ +function addClassToElement(ele, cl) { + ele.className += " " + cl; +} + +// function fancyLog(text, element) { +// console.log(text); +// // Now what goes in here? +// var element = document.createElement(element); +// element.innerHTML = text; +// document.querySelector("#log").appendChild(element); +// } + +var p = document.getElementById("item"); +addClassToElement(p, "class1"); + +/* 3) + +A function that creates any type of element given, adds content to it, and adds it to the page in an intended parent. The code below should work. The PARENT should be a DOM object, not a selector. */ + +function addItemToParent(ele, text, parent) { + var ele = document.createElement(ele); + ele.innerHTML = text; + parent.appendChild(ele); +} + +var parent = document.getElementById("container"); +addItemToParent("h1", "This is some content",parent); \ No newline at end of file