Difference between revisions of "Anatomy of a Webpage 1"

From FreekiWiki
Jump to navigation Jump to search
m
m
Line 6: Line 6:
 
*CSS = '''C'''ascading '''S'''tyle '''S'''heets
 
*CSS = '''C'''ascading '''S'''tyle '''S'''heets
 
CSS provides the styling for one or more web pages.
 
CSS provides the styling for one or more web pages.
*JS = '''J'''ava'''S'''cript (no relation to Java)
+
*JS = '''J'''ava'''S'''cript (No relation to Java. Really.)
 
JavaScript provides the actions or functionality for one or more webpages.
 
JavaScript provides the actions or functionality for one or more webpages.
 
*Browser = Software which renders/displays webpages.
 
*Browser = Software which renders/displays webpages.

Revision as of 04:40, 20 March 2013

In this class we'll talk a little about webpages; including basic network architecture, history, syntax and tools to deconstruct other webpages as open source.

Basic Terminology

  • HTML = HyperText Markup Language

HTML is used to create the structure of a web page.

  • CSS = Cascading Style Sheets

CSS provides the styling for one or more web pages.

  • JS = JavaScript (No relation to Java. Really.)

JavaScript provides the actions or functionality for one or more webpages.

  • Browser = Software which renders/displays webpages.

The browser is software which takes these three languages, and interprets them. (called rendering)

  • Client = End-user device, running browser software.

Clients are devices (or software) which connect to a server. Any internet-connected device can be considered a client.

  • Server = Powerful computers running application software and/or providing [HTML] files.

Servers are (often powerful) computers running server software. They run applications (such as CMS) and provide files. (such as HTML/CSS/JS and images)

All Web Pages Are Created Equal

All webpages are created equal. They're all open source. Servers send raw HTML, (and likely) CSS, JavaScript and images "over the wire" to the client device, where the browser takes these components, and renders them together, making a webpage. Press CTRL+U in any browser, and you can see the source code for any given webpage. In this way, every webpage can be learned from, by simply reading the available code.

Many webpages have CSS and JavaScript (observe some <link> and <script> tags) but not all, and it's certainly not required. Some pages have a little CSS and JavaScript, but some have tons. CSS and JavaScript are great things, but without HTML, they can't exist. They modify, act upon and operate HTML elements.

Each browser has it's own quirks and differences in interpretations of these languages. There are strong commonalities, but differences remain. Each browser has a rendering engine at it's core. This engine consumes the raw HTML, CSS and JavaScript, and produces the visual output of a webpage.

  • Firefox uses the Gecko engine.
  • Chrome, Safari and Opera use the Webkit engine.
  • Internet Explorer uses the Trident engine.

Instructor Notes

  • Students should load a favorite webpage, and press CTRL+U. As a class, discuss the findings.
  • Students should launch Leafpad, and create a new, empty file on the desktop with their first name, in lowercase "name.html".
  • Double-click that file to open it in the browser.
  • Begin building the HTML structure, bit-by-bit, discussing things such as proper syntax.
    • make changes
    • save changes
    • reload browser
  • Students should find a simple image (like a kitty) and download it to the desktop, named "name.jpg" or similar.

Points to Discuss

  • Most HTML tags are formatted like this:
<tag attribute="value">something</tag>.
  • Some HTML tags (like images) don't have a pair:
<img src="" alt="" />.
  • HTML 5 specification includes the addition of new tags, such as <audio> and <video>, and the deprecation of others, such as <table>, <b> and <center>.

Final Structure

<html>
  <head>
    <title>My First Webpage</title>
  </head>
  <body>
    <h1>Headline</h1>
    <p>Paragraph text.</p>
    <img src="name.jpg" alt="Kitty" />
  </body>
</html>

Resources