際際滷

際際滷Share a Scribd company logo
The Basics of Web
Development (Front End)
BY MV HACKS
Some Editors to Download
 Geany
 Notepad ++
 Sublime Text
 Eclipse (or other IDEs)
 Brackets
What You will Learn Today
 HTML
 CSS
Why WebDev?
 Create cool looking websites
 Hack online games (like Cookie Clicker!!)
 Create your own online games
How Websites Work
 Website = HTML document + resources (CSS,
images, JavaScript)
 Browsers (Chrome, Firefox, etc.) read HTML and
render the appropriate page
Or if Internet Explorer, the wrong page
 Websites can be on your local computer or on a web
server
Basics of Front End Web Dev PowerPoint
What is HTML?
 HTML = Hyper Text Markup Language
 Language of the web!
All webpages are structured in HTML
Composed of elements which consist of tags
Tags mark beginning and end of elements
Ex. A paragraph element - <p>Paragraph Content</p>
Common Elements
Common Elements
HTML - <html></html>
Head - <head></head>
Body - <body></body>
Heading - <h1></h1>
Paragraph - <p></p>
Anchor - <a></a>
Image - <img />
Starting
 HTML documents start with <!DOCTYPE html>
 Tells browser to render as HTML5
Then <html> to put everything inside
 Most elements need to be closed
 HTML is highest order, so end with </html>
<!DOCTYPE html>
<html>
<!- all the webpages elements -->
</html>
Header Element
 Next is the head element, <head>
This is where you bring in style files, scripts, etc.
No actual content seen on the page will be here!
Ex. Titles, Style tags (CSS basically), etc.
<!DOCTYPE html>
<html>
<head>
<title> Lets Hack!! </title>
</head>
</html>
Body Element
 Finally the body element, <body>
The body of the html file
 Where you put images, paragraphs, bullet points,
etc.
<!DOCTYPE html>
<html>
<head>
<title> Lets Hack!! </title>
</head>
<body>
<p>Hello world! Congratulations on making
your first page!</p>
</body>
</html>
Saving and Viewing
File -> save as nameofFile.html
 Naming doesnt matter
 MvHacks.html
 HTML files dont need to be compiled
Open browser, click File -> Open file. and navigate to your
html document
 Or with Brackets, use live-view (sideways lightning bolt)
HTML Details 1
 Headings, <h1> . <h6>
 6 different levels, appropriately used to section content
 Cannot nest headings in each other, like <h1><h2></h2></h1>, that is bad
 How to use:
<h1>Favorite Foods</h1>
<h2>Korean Food</h2>
<p>Korean food is awesome!</p>
<h2>Thai Food</h2>
<p>Thai food is also awesome!</p>
HTML Details 2
Paragraph, <p>
 Most common/general text element
 Automatically includes margins (spacing) between paragraphs
Line break, <br>
 Separates lines of text
 Can be placed in a <p> element
<p>The following sentence is true.<br> The previous sentence is
false.</p> Output:
The following sentence is true.
The previous sentence is false.
HTML Details 3
 Anchor (link), <a>
 Used to create hyperlink to separate content
 Must declare href attribute with value as destination
Destination can be URL (http://www.google.com/) or a relative
destination (doc2.html)
 Link text enclosed in element
<a href=http://www.google.com/>This link goes to Google.</a>
<a href=doc2.html>This link goes to doc2</a>
HTML Details 4
 Blocks, <div>
 Used to separate different sections of an html doc
 You can nest as many as these within each other as you want, but keep in mind to close each one!
 You can also set ids to them to set them apart (useful for CSS)
<div id=tasty_delicious_food></div>
<div id=Food>
<div id = more_food>
<div id = even_more_food>
</div>
</div>
</div>
HTML Details 5
 Image, <img>
 Used to input images into the doc
 You can specify width and height through the tag
 Width & height are both in measured in pixels
 The <img> doesnt have a closing tag
<img src=/slideshow/basics-of-front-end-web-dev-powerpoint-53856351/53856351/penguinsFlying.jpg >
<img src=moreFlyingStuff.jpg width=100 height=100>
HTML Details 6
Lists
 <ul> - unordered lists aka bullet lists
 <ol> - ordered lists aka numbered lists
 <li> - these will be the individual points within each list
<ul>
<li>Birds</li>
<li>Penguins</li> </ul>
<ol>
<li>Fuzzy Creatures</li>
<li>Pandas</li> </ol>
Output:
 Birds
 Penguins
1. Fuzzy Creatures
2. Pandas
Hands-On Part 1
Create a VERY basic HTML website that includes:
1. At least one picture
2. A proper title (for the webpage)
3. A few sentences (in bullet or numbered points) about yourself
4. Anything else you want
You have 5 minutes. If you are done or need
help, raise your hand.
HTML Details 7
Tables, <table>
 Are used to display data in a table-like fashion
 If you dont specify a border, itll display with no borders
<table border = 1>
<tr>
<td>Blah</td>
</tr>
<tr>
<td>Blah again</td>
</tr>
</table>
HTML 5
 Cool new HTML version that includes:
 <video> is used to embed a YouTube-esque video player in your website
 Supported video formats include MP4, Ogg, and WebM
<video src=/slideshow/basics-of-front-end-web-dev-powerpoint-53856351/53856351/"Ep. 35 - The Tales of Ba Sing Se.mp4" controls>
Your browser does not support the video element.
</video>
 <audio> is used to embed an audio player in your website
 Supported audio formats include MP3, Wav, and Ogg
<audio src="leaves.mp3" controls>
Your browser does not support the audio element.
</audio>
<header>
<nav>
<!-- navigation links -->
</nav>
</header>
<section>
<h1></h1>
<p></p>
</section>
<footer>
&copy; 2015 MV HACKS
</footer>
Basics of Front End Web Dev PowerPoint
What is CSS?
 CSS stands for Cascade Style Sheets
 CSS allows you to style your webpages by matching the
rules with HTML tags
 This is were <div> ids come in handy!
How to Incorporate CSS
1. Make an external CSS spreadsheet (style.css)
 Add with <link rel = stylesheet type=text/css href=style.css>
 Must be in the <head> section!
 CSS file must be in same folder as HTML
2. Internal CSS
 Put everything in between <style> </style> elements
 Again, must be in the <head> section
3. Inline Stylesheet
 Manually write style=
 Like: <p style=color: # 421c52;> Yo! </p>
Some Syntax
body {
background: #ffffff;
font-size: 16px;
}
div#css_lessons {
width: 100%;
height: 960px;
background: #421c52;
}
Whatever is in the {} is what you are modifying
If you gave an ID, then you have to use #Idname
selector
If you have a class, then the .classname selector
Generally, most things like font-size work in the
syntax ->
nameofRule:
CSS Selectors 1
 Tag
 Use element name, applies to all elements of that type in the document
p { color: blue; }
 Class
 Use class name, applies to all elements of that class in the document
.subtext { font-weight: bold; }
 ID
 Use id name, applies to only element with specified id
#key { font-size: 28px; }
CSS Selectors 2
 You can group selectors together in the same CSS rule
 Enclosed properties apply to all selected elements
/* Applies to all paragraph elements, and heading 1s with id title */
p, h1#title {
font-style: italic;
}
CSS Properties 1
 Text properties
 Font-family
 Font-style
 Font-size
 Font-weight
 Color
p {
font-weight: bold;
font-style: italic;
font-size: 20px;
font-family: serif;
color: #666666;
}
/* All paragraphs are now bold, italic, 20px large, serif font, and gray */
CSS Properties 2
Background properties
 Background-color
 Background-image
 Background-repeat
 Background-attachment
 Background-position
body {
background-image: url(/slideshow/basics-of-front-end-web-dev-powerpoint-53856351/53856351/background.png);
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center top;
}
/* Sets bodys background image as fixed at
the top of the page */
CSS Positioning
 Margin
 Space surrounding element
 Border
 Element border
 Padding
 Space surrounding element content
CSS Positioning 1
Margin:
 Clears a space around your element
 Imagine theres a border around it, margin clears
everything outside of it
 Usable one of two ways: long-hand way or short-hand
way
/*creates a margin above, right, below, left  shorthand*/
div#Hacks {
margin: 5px 6px 7px 8px;
}
/*creates a margin above,right, below, left  longhand*/
div#Hacks {
margin-top: 5px;
margin-right: 6px;
margin-bottom: 7px;
margin-left: 8px;
}
CSS Positioning 2
 Margins  a useful trick for aligning the element into the center of the page
/*centers an element into the center of the page*/
div#pieText {
margin: 0 auto;
}
 Why does this work?
 The 0 tells the browser to set the top and bottom margins to 0
 The auto tells the browser to split up the left and right evenly so the element is centered
CSS Positioning 3
Padding:
 Clears a space around the content within the
element
 Imagine a box around the element, padding
applies to everything within the border
/*creates padding above, right, below, left 
shorthand*/
p {
padding: 5px 6px 7px 8px;
}
/*creates padding above, right, below, left 
longhand*/
p {
padding-top: 5px;
padding-right: 6px;
padding-bottom: 7px;
padding-left: 8px;
}
CSS Positioning 4
 Floating
 Allow you to float an element left or right
 Great for layouts and images
*Float to the left*/
div#pieImage {
float: left;
}
/*Float to the right*/
div#pieImage {
float: right;
}
Hands-On Part 2
Take your previous HTML website and using CSS,
1. Add at least 1 class and 1 ID and style them
2. Style the background (colors, designs, etc.)
3. Style the sentences you wrote (colors, fonts, etc.)
4. Challenge: put some padding on the image and center it
You have 5 minutes. If you are done or need
help, raise your hand.

More Related Content

What's hot (20)

Web Content Mining
Web Content MiningWeb Content Mining
Web Content Mining
Daminda Herath
Web Crawlers
Web CrawlersWeb Crawlers
Web Crawlers
Suhasini S Kulkarni
HTML Semantic Tags
HTML Semantic TagsHTML Semantic Tags
HTML Semantic Tags
Bruce Kyle
Precision and Recall
Precision and RecallPrecision and Recall
Precision and Recall
Johannes Schildgen
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
Eliran Eliassy
Web crawler
Web crawlerWeb crawler
Web crawler
anusha kurapati
CSS For Backend Developers
CSS For Backend DevelopersCSS For Backend Developers
CSS For Backend Developers
10Clouds
Website optimization
Website optimizationWebsite optimization
Website optimization
Mindfire Solutions
Bootstrap PPT by Mukesh
Bootstrap PPT by MukeshBootstrap PPT by Mukesh
Bootstrap PPT by Mukesh
Mukesh Kumar
JavaScript guide 2020 Learn JavaScript
JavaScript guide 2020 Learn JavaScriptJavaScript guide 2020 Learn JavaScript
JavaScript guide 2020 Learn JavaScript
Laurence Svekis
HTML CSS Basics
HTML CSS BasicsHTML CSS Basics
HTML CSS Basics
Mai Moustafa
Css
CssCss
Css
Hemant Saini
Html5 semantics
Html5 semanticsHtml5 semantics
Html5 semantics
Webtech Learning
Information Retrieval Techniques of Google
Information Retrieval Techniques of Google Information Retrieval Techniques of Google
Information Retrieval Techniques of Google
Cyr Ish
Introduction to deep learning
Introduction to deep learningIntroduction to deep learning
Introduction to deep learning
Junaid Bhat
Presentation of bootstrap
Presentation of bootstrapPresentation of bootstrap
Presentation of bootstrap
1amitgupta
jQuery
jQueryjQuery
jQuery
Jay Poojara
Html form tag
Html form tagHtml form tag
Html form tag
shreyachougule
An Introduction to the DOM
An Introduction to the DOMAn Introduction to the DOM
An Introduction to the DOM
Mindy McAdams
HTML CSS JS in Nut shell
HTML  CSS JS in Nut shellHTML  CSS JS in Nut shell
HTML CSS JS in Nut shell
Ashwin Shiv
HTML Semantic Tags
HTML Semantic TagsHTML Semantic Tags
HTML Semantic Tags
Bruce Kyle
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
Eliran Eliassy
CSS For Backend Developers
CSS For Backend DevelopersCSS For Backend Developers
CSS For Backend Developers
10Clouds
Bootstrap PPT by Mukesh
Bootstrap PPT by MukeshBootstrap PPT by Mukesh
Bootstrap PPT by Mukesh
Mukesh Kumar
JavaScript guide 2020 Learn JavaScript
JavaScript guide 2020 Learn JavaScriptJavaScript guide 2020 Learn JavaScript
JavaScript guide 2020 Learn JavaScript
Laurence Svekis
HTML CSS Basics
HTML CSS BasicsHTML CSS Basics
HTML CSS Basics
Mai Moustafa
Information Retrieval Techniques of Google
Information Retrieval Techniques of Google Information Retrieval Techniques of Google
Information Retrieval Techniques of Google
Cyr Ish
Introduction to deep learning
Introduction to deep learningIntroduction to deep learning
Introduction to deep learning
Junaid Bhat
Presentation of bootstrap
Presentation of bootstrapPresentation of bootstrap
Presentation of bootstrap
1amitgupta
An Introduction to the DOM
An Introduction to the DOMAn Introduction to the DOM
An Introduction to the DOM
Mindy McAdams
HTML CSS JS in Nut shell
HTML  CSS JS in Nut shellHTML  CSS JS in Nut shell
HTML CSS JS in Nut shell
Ashwin Shiv

Viewers also liked (13)

Front-end Web Dev (HK) Info Session
Front-end Web Dev (HK) Info SessionFront-end Web Dev (HK) Info Session
Front-end Web Dev (HK) Info Session
Allison Baum
Anyanwu Emmanuel Stock Handler
Anyanwu Emmanuel Stock HandlerAnyanwu Emmanuel Stock Handler
Anyanwu Emmanuel Stock Handler
Emmanuel Anyanwu
php lesson 1
php lesson 1php lesson 1
php lesson 1
Kamar Blbel
Front-End Frameworks: a quick overview
Front-End Frameworks: a quick overviewFront-End Frameworks: a quick overview
Front-End Frameworks: a quick overview
Diacode
League of extraordinary front end dev tools
League of extraordinary front end dev toolsLeague of extraordinary front end dev tools
League of extraordinary front end dev tools
Sherif Tariq
Professional Front End Development
Professional Front End DevelopmentProfessional Front End Development
Professional Front End Development
nelsonmenezes
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Development
mwrather
犖犖項犖÷厳犖犖犖迦県犖 HTML 犢犖ム鍵犖犖迦牽犖犖園犖犢犖犖犖о顕犖
犖犖項犖÷厳犖犖犖迦県犖 HTML 犢犖ム鍵犖犖迦牽犖犖園犖犢犖犖犖о顕犖犖犖項犖÷厳犖犖犖迦県犖 HTML 犢犖ム鍵犖犖迦牽犖犖園犖犢犖犖犖о顕犖
犖犖項犖÷厳犖犖犖迦県犖 HTML 犢犖ム鍵犖犖迦牽犖犖園犖犢犖犖犖о顕犖
Pakornkrits
犖犖項犖÷厳犖 Photoshop cs3
犖犖項犖÷厳犖 Photoshop cs3犖犖項犖÷厳犖 Photoshop cs3
犖犖項犖÷厳犖 Photoshop cs3
charuwarin
犖犖項犖÷厳犖犖犖迦牽犢犖犢犖犖迦 Photoshop cs
犖犖項犖÷厳犖犖犖迦牽犢犖犢犖犖迦 Photoshop cs犖犖項犖÷厳犖犖犖迦牽犢犖犢犖犖迦 Photoshop cs
犖犖項犖÷厳犖犖犖迦牽犢犖犢犖犖迦 Photoshop cs
surachet179
Adobe Photoshop
Adobe PhotoshopAdobe Photoshop
Adobe Photoshop
Government Engineering College, Gandhinagar
Understand front end developer
Understand front end developerUnderstand front end developer
Understand front end developer
Hsuan Fu Lien
reveal.js 3.0.0
reveal.js 3.0.0reveal.js 3.0.0
reveal.js 3.0.0
Hakim El Hattab
Front-end Web Dev (HK) Info Session
Front-end Web Dev (HK) Info SessionFront-end Web Dev (HK) Info Session
Front-end Web Dev (HK) Info Session
Allison Baum
Anyanwu Emmanuel Stock Handler
Anyanwu Emmanuel Stock HandlerAnyanwu Emmanuel Stock Handler
Anyanwu Emmanuel Stock Handler
Emmanuel Anyanwu
Front-End Frameworks: a quick overview
Front-End Frameworks: a quick overviewFront-End Frameworks: a quick overview
Front-End Frameworks: a quick overview
Diacode
League of extraordinary front end dev tools
League of extraordinary front end dev toolsLeague of extraordinary front end dev tools
League of extraordinary front end dev tools
Sherif Tariq
Professional Front End Development
Professional Front End DevelopmentProfessional Front End Development
Professional Front End Development
nelsonmenezes
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Development
mwrather
犖犖項犖÷厳犖犖犖迦県犖 HTML 犢犖ム鍵犖犖迦牽犖犖園犖犢犖犖犖о顕犖
犖犖項犖÷厳犖犖犖迦県犖 HTML 犢犖ム鍵犖犖迦牽犖犖園犖犢犖犖犖о顕犖犖犖項犖÷厳犖犖犖迦県犖 HTML 犢犖ム鍵犖犖迦牽犖犖園犖犢犖犖犖о顕犖
犖犖項犖÷厳犖犖犖迦県犖 HTML 犢犖ム鍵犖犖迦牽犖犖園犖犢犖犖犖о顕犖
Pakornkrits
犖犖項犖÷厳犖 Photoshop cs3
犖犖項犖÷厳犖 Photoshop cs3犖犖項犖÷厳犖 Photoshop cs3
犖犖項犖÷厳犖 Photoshop cs3
charuwarin
犖犖項犖÷厳犖犖犖迦牽犢犖犢犖犖迦 Photoshop cs
犖犖項犖÷厳犖犖犖迦牽犢犖犢犖犖迦 Photoshop cs犖犖項犖÷厳犖犖犖迦牽犢犖犢犖犖迦 Photoshop cs
犖犖項犖÷厳犖犖犖迦牽犢犖犢犖犖迦 Photoshop cs
surachet179
Understand front end developer
Understand front end developerUnderstand front end developer
Understand front end developer
Hsuan Fu Lien

Similar to Basics of Front End Web Dev PowerPoint (20)

Lecture 2 - HTML Basics
Lecture 2 - HTML BasicsLecture 2 - HTML Basics
Lecture 2 - HTML Basics
KULeuven-OnlinePublishing
Code & Design your first website 4/18
Code & Design your first website 4/18Code & Design your first website 4/18
Code & Design your first website 4/18
TJ Stalcup
Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)
Thinkful
Web 101 intro to html
Web 101  intro to htmlWeb 101  intro to html
Web 101 intro to html
Hawkman Academy
Artdm171 Week4 Tags
Artdm171 Week4 TagsArtdm171 Week4 Tags
Artdm171 Week4 Tags
Gilbert Guerrero
The web context
The web contextThe web context
The web context
Dan Phiffer
Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Web Design Bootcamp - Day1
Web Design Bootcamp - Day1
Aslam Najeebdeen
What's a web page made of?
What's a web page made of?What's a web page made of?
What's a web page made of?
Charlie Allen
Html css crash course may 11th, atlanta
Html css crash course may 11th, atlantaHtml css crash course may 11th, atlanta
Html css crash course may 11th, atlanta
Thinkful
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)
Fran巽ois Massart
Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3
Tadpole Collective
Class1slides
Class1slidesClass1slides
Class1slides
Alexis Goldstein
Castro Chapter 3
Castro Chapter 3Castro Chapter 3
Castro Chapter 3
Jeff Byrnes
HTML, CSS, JavaScript for beginners
HTML, CSS, JavaScript for beginnersHTML, CSS, JavaScript for beginners
HTML, CSS, JavaScript for beginners
PrakritiDhang
Lab_Ex1.pptx
Lab_Ex1.pptxLab_Ex1.pptx
Lab_Ex1.pptx
sherrilsiddhardh
HTML Webinar Class
HTML Webinar ClassHTML Webinar Class
HTML Webinar Class
Brian Pichman
Intro to HTML
Intro to HTMLIntro to HTML
Intro to HTML
aakash choudhary
Source Ordered Templates - - Joomla!Days NL 2009 #jd09nl
Source Ordered Templates - - Joomla!Days NL 2009 #jd09nlSource Ordered Templates - - Joomla!Days NL 2009 #jd09nl
Source Ordered Templates - - Joomla!Days NL 2009 #jd09nl
Joomla!Days Netherlands
DESIGN THINKING SYLLABUS MATERIAL NOTES UNIT 1 .pptx
DESIGN THINKING SYLLABUS MATERIAL NOTES UNIT 1 .pptxDESIGN THINKING SYLLABUS MATERIAL NOTES UNIT 1 .pptx
DESIGN THINKING SYLLABUS MATERIAL NOTES UNIT 1 .pptx
bmit1
Lab1_HTML.pptx
Lab1_HTML.pptxLab1_HTML.pptx
Lab1_HTML.pptx
IslamGhonimi1
Code & Design your first website 4/18
Code & Design your first website 4/18Code & Design your first website 4/18
Code & Design your first website 4/18
TJ Stalcup
Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)
Thinkful
Web 101 intro to html
Web 101  intro to htmlWeb 101  intro to html
Web 101 intro to html
Hawkman Academy
The web context
The web contextThe web context
The web context
Dan Phiffer
Web Design Bootcamp - Day1
Web Design Bootcamp - Day1Web Design Bootcamp - Day1
Web Design Bootcamp - Day1
Aslam Najeebdeen
What's a web page made of?
What's a web page made of?What's a web page made of?
What's a web page made of?
Charlie Allen
Html css crash course may 11th, atlanta
Html css crash course may 11th, atlantaHtml css crash course may 11th, atlanta
Html css crash course may 11th, atlanta
Thinkful
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)
Fran巽ois Massart
Castro Chapter 3
Castro Chapter 3Castro Chapter 3
Castro Chapter 3
Jeff Byrnes
HTML, CSS, JavaScript for beginners
HTML, CSS, JavaScript for beginnersHTML, CSS, JavaScript for beginners
HTML, CSS, JavaScript for beginners
PrakritiDhang
HTML Webinar Class
HTML Webinar ClassHTML Webinar Class
HTML Webinar Class
Brian Pichman
Source Ordered Templates - - Joomla!Days NL 2009 #jd09nl
Source Ordered Templates - - Joomla!Days NL 2009 #jd09nlSource Ordered Templates - - Joomla!Days NL 2009 #jd09nl
Source Ordered Templates - - Joomla!Days NL 2009 #jd09nl
Joomla!Days Netherlands
DESIGN THINKING SYLLABUS MATERIAL NOTES UNIT 1 .pptx
DESIGN THINKING SYLLABUS MATERIAL NOTES UNIT 1 .pptxDESIGN THINKING SYLLABUS MATERIAL NOTES UNIT 1 .pptx
DESIGN THINKING SYLLABUS MATERIAL NOTES UNIT 1 .pptx
bmit1

Basics of Front End Web Dev PowerPoint

  • 1. The Basics of Web Development (Front End) BY MV HACKS
  • 2. Some Editors to Download Geany Notepad ++ Sublime Text Eclipse (or other IDEs) Brackets
  • 3. What You will Learn Today HTML CSS
  • 4. Why WebDev? Create cool looking websites Hack online games (like Cookie Clicker!!) Create your own online games
  • 5. How Websites Work Website = HTML document + resources (CSS, images, JavaScript) Browsers (Chrome, Firefox, etc.) read HTML and render the appropriate page Or if Internet Explorer, the wrong page Websites can be on your local computer or on a web server
  • 7. What is HTML? HTML = Hyper Text Markup Language Language of the web! All webpages are structured in HTML Composed of elements which consist of tags Tags mark beginning and end of elements Ex. A paragraph element - <p>Paragraph Content</p>
  • 8. Common Elements Common Elements HTML - <html></html> Head - <head></head> Body - <body></body> Heading - <h1></h1> Paragraph - <p></p> Anchor - <a></a> Image - <img />
  • 9. Starting HTML documents start with <!DOCTYPE html> Tells browser to render as HTML5 Then <html> to put everything inside Most elements need to be closed HTML is highest order, so end with </html>
  • 10. <!DOCTYPE html> <html> <!- all the webpages elements --> </html>
  • 11. Header Element Next is the head element, <head> This is where you bring in style files, scripts, etc. No actual content seen on the page will be here! Ex. Titles, Style tags (CSS basically), etc.
  • 12. <!DOCTYPE html> <html> <head> <title> Lets Hack!! </title> </head> </html>
  • 13. Body Element Finally the body element, <body> The body of the html file Where you put images, paragraphs, bullet points, etc.
  • 14. <!DOCTYPE html> <html> <head> <title> Lets Hack!! </title> </head> <body> <p>Hello world! Congratulations on making your first page!</p> </body> </html>
  • 15. Saving and Viewing File -> save as nameofFile.html Naming doesnt matter MvHacks.html HTML files dont need to be compiled Open browser, click File -> Open file. and navigate to your html document Or with Brackets, use live-view (sideways lightning bolt)
  • 16. HTML Details 1 Headings, <h1> . <h6> 6 different levels, appropriately used to section content Cannot nest headings in each other, like <h1><h2></h2></h1>, that is bad How to use: <h1>Favorite Foods</h1> <h2>Korean Food</h2> <p>Korean food is awesome!</p> <h2>Thai Food</h2> <p>Thai food is also awesome!</p>
  • 17. HTML Details 2 Paragraph, <p> Most common/general text element Automatically includes margins (spacing) between paragraphs Line break, <br> Separates lines of text Can be placed in a <p> element <p>The following sentence is true.<br> The previous sentence is false.</p> Output: The following sentence is true. The previous sentence is false.
  • 18. HTML Details 3 Anchor (link), <a> Used to create hyperlink to separate content Must declare href attribute with value as destination Destination can be URL (http://www.google.com/) or a relative destination (doc2.html) Link text enclosed in element <a href=http://www.google.com/>This link goes to Google.</a> <a href=doc2.html>This link goes to doc2</a>
  • 19. HTML Details 4 Blocks, <div> Used to separate different sections of an html doc You can nest as many as these within each other as you want, but keep in mind to close each one! You can also set ids to them to set them apart (useful for CSS) <div id=tasty_delicious_food></div> <div id=Food> <div id = more_food> <div id = even_more_food> </div> </div> </div>
  • 20. HTML Details 5 Image, <img> Used to input images into the doc You can specify width and height through the tag Width & height are both in measured in pixels The <img> doesnt have a closing tag <img src=/slideshow/basics-of-front-end-web-dev-powerpoint-53856351/53856351/penguinsFlying.jpg > <img src=moreFlyingStuff.jpg width=100 height=100>
  • 21. HTML Details 6 Lists <ul> - unordered lists aka bullet lists <ol> - ordered lists aka numbered lists <li> - these will be the individual points within each list <ul> <li>Birds</li> <li>Penguins</li> </ul> <ol> <li>Fuzzy Creatures</li> <li>Pandas</li> </ol> Output: Birds Penguins 1. Fuzzy Creatures 2. Pandas
  • 22. Hands-On Part 1 Create a VERY basic HTML website that includes: 1. At least one picture 2. A proper title (for the webpage) 3. A few sentences (in bullet or numbered points) about yourself 4. Anything else you want You have 5 minutes. If you are done or need help, raise your hand.
  • 23. HTML Details 7 Tables, <table> Are used to display data in a table-like fashion If you dont specify a border, itll display with no borders <table border = 1> <tr> <td>Blah</td> </tr> <tr> <td>Blah again</td> </tr> </table>
  • 24. HTML 5 Cool new HTML version that includes: <video> is used to embed a YouTube-esque video player in your website Supported video formats include MP4, Ogg, and WebM <video src=/slideshow/basics-of-front-end-web-dev-powerpoint-53856351/53856351/"Ep. 35 - The Tales of Ba Sing Se.mp4" controls> Your browser does not support the video element. </video> <audio> is used to embed an audio player in your website Supported audio formats include MP3, Wav, and Ogg <audio src="leaves.mp3" controls> Your browser does not support the audio element. </audio>
  • 25. <header> <nav> <!-- navigation links --> </nav> </header> <section> <h1></h1> <p></p> </section> <footer> &copy; 2015 MV HACKS </footer>
  • 27. What is CSS? CSS stands for Cascade Style Sheets CSS allows you to style your webpages by matching the rules with HTML tags This is were <div> ids come in handy!
  • 28. How to Incorporate CSS 1. Make an external CSS spreadsheet (style.css) Add with <link rel = stylesheet type=text/css href=style.css> Must be in the <head> section! CSS file must be in same folder as HTML 2. Internal CSS Put everything in between <style> </style> elements Again, must be in the <head> section 3. Inline Stylesheet Manually write style= Like: <p style=color: # 421c52;> Yo! </p>
  • 29. Some Syntax body { background: #ffffff; font-size: 16px; } div#css_lessons { width: 100%; height: 960px; background: #421c52; } Whatever is in the {} is what you are modifying If you gave an ID, then you have to use #Idname selector If you have a class, then the .classname selector Generally, most things like font-size work in the syntax -> nameofRule:
  • 30. CSS Selectors 1 Tag Use element name, applies to all elements of that type in the document p { color: blue; } Class Use class name, applies to all elements of that class in the document .subtext { font-weight: bold; } ID Use id name, applies to only element with specified id #key { font-size: 28px; }
  • 31. CSS Selectors 2 You can group selectors together in the same CSS rule Enclosed properties apply to all selected elements /* Applies to all paragraph elements, and heading 1s with id title */ p, h1#title { font-style: italic; }
  • 32. CSS Properties 1 Text properties Font-family Font-style Font-size Font-weight Color p { font-weight: bold; font-style: italic; font-size: 20px; font-family: serif; color: #666666; } /* All paragraphs are now bold, italic, 20px large, serif font, and gray */
  • 33. CSS Properties 2 Background properties Background-color Background-image Background-repeat Background-attachment Background-position body { background-image: url(/slideshow/basics-of-front-end-web-dev-powerpoint-53856351/53856351/background.png); background-repeat: no-repeat; background-attachment: fixed; background-position: center top; } /* Sets bodys background image as fixed at the top of the page */
  • 34. CSS Positioning Margin Space surrounding element Border Element border Padding Space surrounding element content
  • 35. CSS Positioning 1 Margin: Clears a space around your element Imagine theres a border around it, margin clears everything outside of it Usable one of two ways: long-hand way or short-hand way /*creates a margin above, right, below, left shorthand*/ div#Hacks { margin: 5px 6px 7px 8px; } /*creates a margin above,right, below, left longhand*/ div#Hacks { margin-top: 5px; margin-right: 6px; margin-bottom: 7px; margin-left: 8px; }
  • 36. CSS Positioning 2 Margins a useful trick for aligning the element into the center of the page /*centers an element into the center of the page*/ div#pieText { margin: 0 auto; } Why does this work? The 0 tells the browser to set the top and bottom margins to 0 The auto tells the browser to split up the left and right evenly so the element is centered
  • 37. CSS Positioning 3 Padding: Clears a space around the content within the element Imagine a box around the element, padding applies to everything within the border /*creates padding above, right, below, left shorthand*/ p { padding: 5px 6px 7px 8px; } /*creates padding above, right, below, left longhand*/ p { padding-top: 5px; padding-right: 6px; padding-bottom: 7px; padding-left: 8px; }
  • 38. CSS Positioning 4 Floating Allow you to float an element left or right Great for layouts and images *Float to the left*/ div#pieImage { float: left; } /*Float to the right*/ div#pieImage { float: right; }
  • 39. Hands-On Part 2 Take your previous HTML website and using CSS, 1. Add at least 1 class and 1 ID and style them 2. Style the background (colors, designs, etc.) 3. Style the sentences you wrote (colors, fonts, etc.) 4. Challenge: put some padding on the image and center it You have 5 minutes. If you are done or need help, raise your hand.