Elements

Elements define structure and content of objects within a page.

Common Elements

Headings <h1> through <h6>

Paragraphs <p>

Anchors <a>

Image <img>

Lists <ul> <ol>

<div>

<span>

<p>

Opening Tag

Left Angle Bracket

Right Angle Bracket

Character

<  p>

Closing Tag

/

Forward Slash

Attributes

Attributes

Properties that provide additional information about an element.

Common Attributes

id

class

src

href

Essential Elements

<!doctype>

<HTML>

<head>

<body>

Doctype

The document type declaration informs web browsers which version of HTML is being used and is placed at the very beginning of the HTML document

HTML 4 Doctype

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

HTML 5 Doctype

<!DOCTYPE html>

<html>

The opening <html> tag indicates that anything between it and the closing </html> tag is HTML code.

<head>

The <head> element is not displayed on the page and is used to outline metadata, including the document title, and links to external files such as your CSS stylesheets.

<body>

The <body> tag indicates that anything between it and the closing </body> tag should be shown inside the main brows

Class Exercise

Selectors

Selectors

 A selector designates exactly which element or elements within our HTML to target and apply styles (such as color, size, and position) to.

p {
    color: #333; 
    font-size: 1em; 
}

Selector

Property

Value

Selectors

  • Type Selectors
  • Class Selectors
  • ID Selectors

 

Advanced Selectors later in the quarter

Creating Links

<a href="http://www.google.com"> Google </a> 
Made with Slides.com