Docsity

HTML Document Structure and Semantic Tags, Slides of Web Design and Development

Partial preview of the text

Download HTML Document Structure and Semantic Tags and more Slides Web Design and Development in PDF only on Docsity!

HTML Document Structure

Doctype, Head, Body, Semantic Tags, Tables, HTML Entities

HTML DOCUMENT STRUCTURE

HTML Document, Doctype, Head, Body

  • The contains markup not visible to the user
    • But helps the browser to render correctly the HTML document
  • What is in the ?
    • Metadata definitions
    • Styles declarations
    • Scripts declarations Head Element
 Specify the character encoding 
  • The tag – HTML document title
  • favicon – a site icon
    • Favicon generator: http://www.favicon-generator.org Head Element: Title + Favicon <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon"/>

<head>

<title>Home - …

Favicon

HTML title

  • A typical layout structure of a Web page The Structure of a Web Page
  • Using s with IDs (the IDs are needed for styling) The "HTML 4 and Old" Way

** … **

… … … … …

HTML5 Semantic Tags

▪

▪

▪

▪

▪

▪

▪

▪ + ▪ + ▪ ▪ ▪ ▪ /

  • – defines a set of navigation links HTML5 Semantic Tags: Nav

Home

Menu

Courses

Solution: Navigation Bar (CSS) body { margin: 0; padding: 0; background: #ccc; } nav#topmenu ul { list-style: none; background-color: #444; text-align: center; padding: 0; margin: 0; } nav#topmenu li { font-size: 24px; line-height: 40px; height: 40px; display: inline-block; padding: 20px; } nav#topmenu a { text-decoration: none; color: #fff; }

  • – holds a document or section header HTML5 Semantic Tags: Header ...

Google buys Nest

Posted at 11:34AM, 13th January 2014

The acquisition brings …

holds title + posted article date

  • – a group of related content Semantic Tags: Section

Heading

Use … to define the topic for the section

  • Create a HTML

  • Holding a few
elements with
  • Like shown on the
screenshot

Problem: Page Content

Solution: Page Content (CSS)

body {

margin: 0;

padding: 0;

background: #ccc;

section {

margin-left: 20px;

h1 {

font-size: 28px;

header > p {

font-style: italic;

article > p {

font-size: 24px;

  • – defines a sidebar (left / right navigation) Semantic Tags: Aside ...

Blogroll

My Friend My Other Friend My Best Friend

Main site content Sidebar: