HTML, beyond the basics

Similar documents
As we design and build out our HTML pages, there are some basics that we may follow for each page, site, and application.

HTML Hyperlinks (Links)

CSS CSS how to display to solve a problem External Style Sheets CSS files CSS Syntax

HTML Summary. All of the following are containers. Structure. Italics Bold. Line Break. Horizontal Rule. Non-break (hard) space.

Programmazione Web a.a. 2017/2018 HTML5

Media, Tables and Links. Kanida Sinmai

Fundamentals of Web Technologies. Agenda: HTML Links 5/22/2017. HTML Links - Hyperlinks HTML Lists

CSC Web Technologies, Spring HTML Review

HTML Images - The <img> Tag and the Src Attribute

A HTML document has two sections 1) HEAD section and 2) BODY section A HTML file is saved with.html or.htm extension

BIM222 Internet Programming

Table of Contents. MySource Matrix Content Types Manual

CSC Web Programming. Introduction to HTML

Fall Semester 2016 (2016-1)

Networks and Web for Health Informatics (HINF 6220) Tutorial 8 : CSS. 8 Oct 2015

Hyper Text Markup Language HTML: A Tutorial

Web Programming Week 2 Semester Byron Fisher 2018

Understanding this structure is pretty straightforward, but nonetheless crucial to working with HTML, CSS, and JavaScript.

CSS. M hiwa ahamad aziz Raparin univercity. 1 Web Design: Lecturer ( m hiwa ahmad aziz)

Module 2 (VI): CSS [Part 3]

HTML What is HTML Hyper Text Markup Language is a computer based language used to create WebPages.

Web Development and HTML. Shan-Hung Wu CS, NTHU

Introduction to Computer Science (I1100) Internet. Chapter 7

BASICS OF WEB DESIGN CHAPTER 2 HTML BASICS KEY CONCEPTS

Introduction to HTML

CSS cont. October 5, Unit 4

By Ryan Stevenson. Guidebook #2 HTML

Programming of web-based systems Introduction to HTML5

CSS.

Introduction to Computer Science Web Development

HTML Text Formatting. HTML Session 2 2

DAY 4. Coding External Style Sheets

IMY 110 Theme 6 Cascading Style Sheets

Web Technologies - by G. Sreenivasulu Handout - 1 UNIT - I

Using Dreamweaver CS6

Web Development & Design Foundations with HTML5 & CSS3 Instructor Materials Chapter 2 Test Bank

CSS Selectors. element selectors. .class selectors. #id selectors

5 Snowdonia. 94 Web Applications with C#.ASP

HTML (Hypertext Mark-up language) Basic Coding

HTML and CSS COURSE SYLLABUS

HTML TAG SUMMARY HTML REFERENCE 18 TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES MOST TAGS

Web Programming and Design. MPT Senior Cycle Tutor: Tamara Week 1

Tables & Lists. Organized Data. R. Scott Granneman. Jans Carton

HTML, CSS. Kristóf Kovács, Róbert Pálovics, Ferenc Wettl Kristóf Kovács, Róbert Pálovics, Ferenc Wettl HTML, CSS / 28

HTML+ CSS PRINCIPLES. Getting started with web design the right way

Chapter 2 CSS for Style

HTML & CSS Cheat Sheet

The default style for an unordered (bulleted) list is the bullet, or dot. You can change the style to either a square or a circle as follows:

Computer Programming. Dr. Deepak B Phatak Dr. Supratik Chakraborty Department of Computer Science and Engineering IIT Bombay

7300 Warden Avenue, Suite 503 Markham, Ontario Canada L3R 9Z6. Phone: Toll Free: Fax:

WTAD Text Editors for HTML. Text Editors: Kate HTML. (HyperText Markup Language)

Final Exam Study Guide

WTAD. Unit -1 Introduction to HTML (HyperText Markup Language)

CSS: Cascading Style Sheets

HTML & CSS November 19, 2014

Using Dreamweaver CC. 6 Styles in Websites. Exercise 1 Linked Styles vs Embedded Styles

MODULE 2 HTML 5 FUNDAMENTALS. HyperText. > Douglas Engelbart ( )

Chapter 7 BMIS335 Web Design & Development

Lab 4 CSS CISC1600, Spring 2012

Parashar Technologies HTML Lecture Notes-4

Purpose of this doc. Most minimal. Start building your own portfolio page!

Creating and Building Websites

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21

CSS exercise - Part 1

Adding CSS to your HTML

Markup Language SGML: Standard Generalized Markup Language. HyperText Markup Language (HTML) extensible Markup Language (XML) TeX LaTeX

GIMP WEB 2.0 MENUS WEB 2.0 MENUS: HORIZONTAL NAVIGATION BAR CREATING AN HTML LIST

Programming Languages

Using Dreamweaver. 6 Styles in Websites. 1. Linked or Imported Stylesheets. 2. Embedded Styles. 3. Inline Styles

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM Advanced Internet Technology Lab.

CSS: Formatting Text. CSS for text processing: font-family. Robert A. Fulkerson

WEBSI TE DESIGNING TRAINING

AGENDA :: MULTIMEDIA TOOLS :: (1382) :: CLASS NOTES

Exam II CIS 228: The Internet Prof. St. John Lehman College City University of New York 5 November 2009

Web Designing HTML5 NOTES

MPT Web Design. Week 1: Introduction to HTML and Web Design

CSS MOCK TEST CSS MOCK TEST III

CSS. Selectors & Measurments. Copyright DevelopIntelligence LLC

With HTML you can create your own Web site. This tutorial teaches you everything about HTML.

COMSC-030 Web Site Development- Part 1. Part-Time Instructor: Joenil Mistal

Certified HTML5 Developer VS-1029

Indian Institute of Technology Kharagpur. HTML Part III. Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. I.I.T.

CSS Cascading Style Sheets

Web Development and Design Foundations with HTML5 8th Edition

COPYRIGHTED MATERIAL. Contents. Chapter 1: Creating Structured Documents 1

CSS: Layout Part 2. clear. CSS for layout and formatting: clear

INTRODUCTION TO WEB USING HTML What is HTML?

Deccansoft Software Services

Unit 10 - Client Side Customisation of Web Pages. Week 5 Lesson 1 CSS - Selectors

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

HTML Hints & Tips. HTML is short for HyperText Markup Language.

HTML: The Basics & Block Elements

Basics of Web Design, 3 rd Edition Instructor Materials Chapter 2 Test Bank

Summary 4/5. (contains info about the html)

It is possible to create webpages without knowing anything about the HTML source behind the page.

1/6/ :28 AM Approved New Course (First Version) CS 50A Course Outline as of Fall 2014

introduction to XHTML

Introduction to HTML. SSE 3200 Web-based Services. Michigan Technological University Nilufer Onder

INTRODUCTION TO HTML5! HTML5 Page Structure!

3.1 Introduction. 3.2 Levels of Style Sheets. - The CSS1 specification was developed in There are three levels of style sheets

Transcription:

HTML, beyond the basics

HTML Classes and IDs Classes are attributes that attach information to an element so you can do more things with some or all elements that belong to a certain class. IDs, like classes, are attributes attached to elements. IDs are unique identifiers for a particular element. They must ALWAYS start with a letter, but you can add numbers afterwards. You would set an ID on an element if you need to particularly do something with that element, like run some JavaScript on it or even set some unique styling on it. <p class="fancy">my fancy paragraph</p> <h1 class="fancy">my fancy heading</h1> <p id="s1">this paragraph can be referred to as s1</p> <h1 id="mytitle">title</h1>

Pseudo-Classes A pseudo-class is used to define a special state of an element. for example: - Style an element when a user mouses over it - Style visited and unvisited links differently - Style an element when it gets focus selector:pseudo-class { } property:value;

Anchor Pseudo-Classes Links can be displayed in different ways: /* unvisited link */ a:link { color: #FF0000; } /* visited link */ a:visited { color: #00FF00; } /* mouse over link */ a:hover { color: #FF00FF; } /* selected link */ a:active { color: #0000FF; } Note: a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective! a:active MUST come after a:hover in the CSS definition in order to be effective! Pseudo-class names are not case-sensitive.

Pseudo-classes and CSS Classes Pseudo-classes can be combined with CSS classes When you hover over the link that belongs to highlight class in this example, it will change color: a.highlight:hover { color: #ff0000; } You can find the complete list of Pseudo-Classes here.

HTML Block and Inline Elements Every HTML element has a default display value depending on what type of element it is. The default display value for most elements is block or inline. A block-level element always starts on a new line and takes up the full width available (stretches out to the left and right as far as it can). An inline element does not start on a new line and only takes up as much width as necessary.

HTML Block and Inline Elements Example Block Elements: Example Inline Elements: <p>, <pre>, <table>, <ul>, <ol>,... <img>, <a>, <b>, <strong>, <small>,... Let's see that in action

<div> Element The <div> element is often used as a container for other HTML elements. The <div> element has no required attributes, but both style and class are common. When used together with CSS, the <div> element can be used to style blocks of content <div style="background-color:black;color:white;padding:20px;"> <h2>london</h2> <p>london is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.</p> </div>

<span> Element The <span> element is often used as a container for some text. The <span> element has no required attributes, but both style and class are common. When used together with CSS, the <span> element can be used to style parts of the inline text <h1>my <span style="color:red">important</span> Heading</h1>

HTML Grouping Elements In other words, <div> and <span> can be seen as grouping elements. - <div> defines one or more block-level sections in a document - <span> defines one or more inline sections in a document.highlight{ color:yellow; } <body> <div id="header"> <h1>my Page Title</h1> </div> <div id="content"> <p>the main content</p> </div> <div id="sidebar"> <p>some <span class="highlight"> stuff</span> in a sidebar</p> </div> <div id="footer"> <p>copyright me</p> </div> </body>

HTML5 Structural/Semantic Elements HTML5 offers new elements for better document structure Structural elements are all block-level elements and help identify the type of content and the area on the page where that content will be placed. <header></header> <nav></nav> <article></article> <section></section> <main></main> <footer></footer> Defines a header for a document or section Defines navigation links Defines an article in a document Defines a section in a document Defines the main content of a document Defines a footer for a document or section You can find the complete list here

More on <head> Element The <head> element is a container for metadata (data about data) and is placed between the <html> tag and the <body> tag. HTML metadata is data about the HTML document. Metadata is not displayed. Metadata typically define the document title, character set, styles, links, scripts, and other meta information.

What is Inside <head>: <title> The <title> element defines the title of the document, and is required in all HTML documents. The <title> element: - defines a title in the browser tab - provides a title for the page when it is added to favorites - displays a title for the page in search engine results <head> <title>page Title</title> </head>

What is Inside <head>: <style> and <link> The <style> element is used to define style information for a single HTML page <head> <style> body {background-color: powderblue;} h1 {color: red;} p {color: blue;} </style> </head> The <link> element is used to link to external style sheets <head> <link rel="stylesheet" href="mystyle.css"> </head>

What is Inside <head>: <meta> The <meta> element is used to specify which character set is used, page description, keywords, author, and other metadata. Metadata is used by browsers (how to display content), by search engines (keywords), and other web services. <meta charset="utf-8"> <meta name="description" content="free Web tutorials"> <meta name="keywords" content="html,css,xml,javascript"> <meta name="author" content="john Doe">

What is Inside <head>: <meta> HTML5 introduced a method to let web designers take control over the viewport, through the <meta> tag. The viewport is the user's visible area of a web page. It varies with the device, and will be smaller on a mobile phone than on a computer screen. <meta name="viewport" content="width=device-width, initial-scale=1.0"> The width=device-width part sets the width of the page to follow the screen-width of the device (which will vary depending on the device). The initial-scale=1.0 part sets the initial zoom level when the page is first loaded by the browser.viewport element in all your web pages:

Viewport check out these two web pages on your phone or tablet: https://www.w3schools.com/html/example_withoutviewport.htm https://www.w3schools.com/html/example_withviewport.htm

More on HTML Links <a href="url">link text</a> HTML bookmarks are used to allow readers to jump to specific parts of a Web page. Bookmarks can be useful if your webpage is very long. To make a bookmark, you must first create the bookmark, and then add a link to it. When the link is clicked, the page will scroll to the location with the bookmark. Check out course web page for a sample

More on HTML Links First, create a bookmark with the id attribute: <h2 id="c4">chapter 4</h2> Then, add a link to the bookmark: <a href="#c4">jump to Chapter 4</a> Or, add a link to the bookmark, from another page: <a href="html_demo.html#c4">jump to Chapter 4</a>

More on HTML Lists Unordered list (bullets) List Item Another List Item Ordered list (sequence) 1. List Item 2. Another List Item <ul> <li>list Item</li> <li>another List Item</li> </ul> <ol> <li>list Item</li> <li>another List Item</li> </ol>

More on HTML Lists For Unordered HTML List we can change List Item Marker The CSS list-style-type property is used to define the style of the list item marker List Item Another List Item <ul style="list-style-type:disc"> <li>list Item</li> <li>another List Item</li> </ul> possible values for list-style-type property are: disc, circle, square, none

More on HTML Lists For ordered HTML List we can change the Type of the List Marker The CSS type property is used to define the type of the ordered list item marker A. List Item B. Another List Item <ol type="a"> <li>list Item</li> <li>another List Item</li> </ol> type="1" type="a" type="a" type="i" type="i" The list items will be numbered with numbers (default) The list items will be numbered with uppercase letters The list items will be numbered with lowercase letters The list items will be numbered with uppercase roman numbers The list items will be numbered with lowercase roman numbers

More on HTML Lists HTML also supports description lists which is a list of terms, with a description of each term. The <dl> tag defines the description list, the <dt> tag defines the term (name), and the <dd> tag describes each term coffee black hot drink milk white cold drink <dl> <dt>coffee</dt> <dd>black hot drink</dd> <dt>milk</dt> <dd>white cold drink</dd> </dl>

More on HTML Tables Firstname Lastname Age Jill Smith 50 Eve Jackson 94 <table> <tr> <th>firstname</th> <th>lastname</th> <th>age</th> </tr> <tr> <td>jill</td> <td>smith</td> <td>50</td> </tr> <tr> <td>eve</td> <td>jackson</td> <td>94</td> </tr> </table>

More on HTML Tables: colspan To make a cell span more than one column, use the colspan attribute: Name Age Jill Smith 50 Eve Jackson 94 <table> <tr> <th colspan="2">name</th> <th>age</th> </tr> <tr> <td>jill</td> <td>smith</td> <td>50</td> </tr> <tr> <td>eve</td> <td>jackson</td> </tr> </table>

More on HTML Tables: rowspan To make a cell span more than one row, use the rowspan attribute: Name Age Jill Smith 50 Eve Jackson <table> <tr> <th colspan="2">name</th> <th>age</th> </tr> <tr> <td>jill</td> <td>smith</td> <td rowspan="2">50</td> </tr> <tr> <td>eve</td> <td>jackson</td> </tr> </table>

More on HTML Tables: caption To add a caption to a table, use the <caption> tag immediately after the <table> tag Random Table Name Age Jill Smith 50 Eve Jackson <table> <caption>random Table</caption> <tr> <th colspan="2">name</th> <th>age</th> </tr> <tr> <td>jill</td> <td>smith</td> <td rowspan="2">50</td> </tr> <tr> <td>eve</td> <td>jackson</td> </tr> </table>