HTML Text Formatting. HTML Session 2 2

Similar documents
Web Designing HTML5 NOTES

Media, Tables and Links. Kanida Sinmai

CSS Cascading Style Sheets

HTML Hyperlinks (Links)

Programmazione Web a.a. 2017/2018 HTML5

Unit 2 - HTML Formatting

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

CSS.

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

<body bgcolor=" " fgcolor=" " link=" " vlink=" " alink=" "> These body attributes have now been deprecated, and should not be used in XHTML.

o Line Breaks </body> </html> This is heading 1 This is some text. This is heading 2 This is some other text. This is heading 2

Skill Area 323: Design and Develop Website. Multimedia and Web Design (MWD)

<page> 1 Document Summary Document Information <page> 2 Document Structure Text Formatting <page> 3 Links Images <page> 4

DAY 4. Coding External Style Sheets

Review Question 1. Which tag is used to create a link to another page? 1. <p> 2. <li> 3. <a> 4. <em>

CMPT 165 Unit 2 Markup Part 2

BIM222 Internet Programming

Creating A Website - Part 1: Web Design principles, HTML & CSS. CSS Color Values. Hexadecimal Colors. RGB Color

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

CSS: The Basics CISC 282 September 20, 2014

Introduction to HTML & CSS. Instructor: Beck Johnson Week 2

CSS Cascading Style Sheets

Tutorial 2 - HTML basics

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

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

Cascading Style Sheets (CSS)

Adding CSS to your HTML

CSS stands for Cascading Style Sheets Styles define how to display HTML elements

CSS. Lecture 16 COMPSCI 111/111G SS 2018

Reading 2.2 Cascading Style Sheets

CSS means Cascading Style Sheets. It is used to style HTML documents.

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

CSS Lecture 16 COMPSCI 111/111G SS 2018

HTML (Hypertext Mark-up language) Basic Coding

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

INFORMATICA GENERALE 2014/2015 LINGUAGGI DI MARKUP CSS

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

Appendix D CSS Properties and Values

Attributes & Images 1 Create a new webpage

3. Each of these mark examples contains an error. a. <input name= country value= Your country here. /> b. <checkbox name= color value= teal />

HTML TUTORIAL ONE. Understanding What XHTML is Not

CSS مفاهیم ساختار و اصول استفاده و به کارگیری

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

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1

Lab 4 CSS CISC1600, Spring 2012

Session 3.1 Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external style sheets Understand style

Web Engineering (Lecture 01)

To link to an external stylesheet, the link element is placed within the head of the html page:

ADDING CSS TO YOUR HTML DOCUMENT. A FEW CSS VALUES (colour, size and the box model)

CSS: Cascading Style Sheets

GIMP WEB 2.0 MENUS. Web 2.0 Menus: Horizontal Navigation Bar with Dynamic Background Image

Cascading Style Sheet. Styles as Tag Attributes. Syntax. <h1>: what font type/size is used? STYLE = SELECTOR {RULES} Attributes such as bgcolor

Welcome Please sit on alternating rows. powered by lucid & no.dots.nl/student

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

Introduction to Web Design CSS Reference

Assignments (4) Assessment as per Schedule (2)

Introduction to Web Design CSS Reference

CSS: Cascading Style Sheets

Index. alt, 38, 57 class, 86, 88, 101, 107 href, 24, 51, 57 id, 86 88, 98 overview, 37. src, 37, 57. backend, WordPress, 146, 148

HTML & CSS Cheat Sheet

Downloads: Google Chrome Browser (Free) - Adobe Brackets (Free) -

The internet is a worldwide collection of networks that link millions of computers. These links allow the computers to share and send data.

Table of Contents. MySource Matrix Content Types Manual

HTML. Based mostly on

Web Publishing with HTML

HTML & CSS. SWE 432, Fall 2017 Design and Implementation of Software for the Web

/

HTML/XML. HTML Continued Introduction to CSS

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

What is CSS? NAME: INSERT OPENING GRAPHIC HERE:

Syllabus - July to Sept

COSC 2206 Internet Tools. CSS Cascading Style Sheets

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

CSS cont. October 5, Unit 4

HTML5. Juha Söderqvist

ITNP43: HTML Lecture 4

Project 1: Creating a Web Site from Scratch. Skills and Tools: Use Expression Web tools to create a Web site

Desire2Learn: HTML Basics

Block & Inline Elements

Methods for configuring Cascading Style Sheets. Applying style to element name selectors. Style Rule Basics. CMPT 165: Cascading Style Sheets

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

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

Creating and Building Websites

Lava New Media s CMS. Documentation Page 1

Web Design 101. What is HTML? HTML Tags. Web Browsers. <!DOCTYPE html> <html> <body> <h1>my First Heading</h1> <p>my first paragraph.

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

Cascading Style Sheets Level 2

Parashar Technologies HTML Lecture Notes-4

Introduction to CSS. Fijihosting.com Introduction to CSS page 1. What are style sheets? Lovely! How do I use them?

Outline. Link HTML With Style Sheets &6&7XWRULDO &66 ;+70/ (GZDUG;LD

Study Guide 2 - HTML and CSS - Chap. 6,8,10,11,12 Name - Alexia Bernardo

Web Development & Design Foundations with HTML5

HTML Code: Headings HTML Headings Headings are defined with the <h1> to <h6> tags. <h1> defines the most important heading. <h6> defines the least

Creating Web Pages with SeaMonkey Composer

The [HTML] Element p. 61 The [HEAD] Element p. 62 The [TITLE] Element p. 63 The [BODY] Element p. 66 HTML Elements p. 66 Core Attributes p.

HTML. Mohammed Alhessi M.Sc. Geomatics Engineering. Internet GIS Technologies كلية اآلداب - قسم الجغرافيا نظم المعلومات الجغرافية

Introduction to using HTML to design webpages

CSC 337. Cascading Style Sheets. Marty Stepp, Rick Mercer

Course Objectives. Application, Commercial Uses, Entertainment and fine arts, JournalismDr.and. Lecture Schedule

Web Development & Design Foundations with HTML5

Transcription:

HTML Session 2

HTML Text Formatting HTML also defines special elements for defining text with a special meaning. <b> - Bold text <strong> - Important text <i> - Italic text <em> - Emphasized text <mark> - Marked text <small> - Small text <del> - Deleted text <ins> - Inserted text <sub> - Subscript text <sup> - Superscript text HTML Session 2 2

HTML Text Formatting The HTML <q> element defines a short quotation. Browsers usually insert quotation marks around the <q> element. The HTML <blockquote> element defines a section that is quoted from another source. Browsers usually indent <blockquote> elements. <p>wwf's goal is to: <q>build a future where people live in harmony with nature.</q></p> <p>here is a quote from WWF's website:</p> <blockquote cite="http://www.worldwildlife.org/who/index.html"> For 50 years, WWF has been protecting the future of nature. The world's leading conservation organization, WWF works in 100 countries and is supported by </blockquote> HTML Session 2 3

HTML Text Formatting HTML <abbr> for Abbreviations The HTML <abbr> element defines an abbreviation or an acronym. Marking abbreviations can give useful information to browsers, translation systems and search-engines. <p>the <abbr title="world Health Organization">WHO</abbr> was founded in 1948.</p> HTML Session 2 4

HTML Text Formatting HTML <address> for Contact Information The HTML <address> element defines contact information (author/owner) of a document or an article. The <address> element is usually displayed in italic. Most browsers will add a line break before and after the element. <address> Written by John Doe.<br> Visit us at:<br> Example.com<br> Box 564, Disneyland<br> USA </address> HTML Session 2 5

HTML Text Formatting HTML <cite> for Work Title The HTML <cite> element defines the title of a work. Browsers usually display <cite> elements in italic. <p><cite>the Scream</cite> by Edvard Munch. Painted in 1893.</p> HTML Session 2 6

HTML Text Formatting HTML <bdo> for Bi-Directional Override The HTML <bdo> element defines bi-directional override. <bdo dir="rtl">this text will be written from right to left</bdo> HTML Session 2 7

HTML Comments Comment tags are used to insert comments in the HTML source code. You can add comments to your HTML source by using the following syntax: Conditional Comments <!-- This is a comment --> <p>this is a paragraph.</p> <!-- Remember to add more information here --> <!--[if IE 9]>... some HTML here... <![endif]--> HTML Session 2 8

HTML Colors Color Names In HTML, a color can be specified by using a color name: HTML Session 2 9

HTML Colors RGB Value In HTML, a color can also be specified as an RGB value, using this formula: rgb(red, green, blue) Each parameter (red, green, and blue) defines the intensity of the color between 0 and 255. For example, rgb(255,0,0) is displayed as red, because red is set to its highest value (255) and the others are set to 0. To display the color black, all color parameters must be set to 0, like this: rgb(0,0,0). To display the color white, all color parameters must be set to 255, like this: rgb(255,255,255). HTML Session 2 10

HTML Colors HEX Value In HTML, a color can also be specified using a hexadecimal value in the form: #RRGGBB, where RR (red), GG (green) and BB (blue) are hexadecimal values between 00 and FF (same as decimal 0-255). For example, #FF0000 is displayed as red, because red is set to its highest value (FF) and the others are set to the lowest value (00). Shades of gray are often defined using equal values for all the 3 light sources: #808080 #404040 HTML Session 2 11

HTML Styles - CSS CSS stands for Cascading Style Sheets. CSS describes how HTML elements are to be displayed on screen, paper, or in other media. CSS can be added to HTML elements in 3 ways: 1. Inline - by using the style attribute in HTML elements 2. Internal - by using a <style> element in the <head> section 3. External - by using an external CSS file The most common way to add CSS, is to keep the styles in separate CSS files. HTML Session 2 12

Inline CSS An inline CSS is used to apply a unique style to a single HTML element. An inline CSS uses the style attribute of an HTML element. This example sets the text color of the <h1> element to blue: <h1 style="color:blue;">this is a Blue Heading</h1> HTML Session 2 13

Internal CSS An internal CSS is used to define a style for a single HTML page. An internal CSS is defined in the <head> section of an HTML page, within a <style> element: <!DOCTYPE html> <html> <head> <style> body {background-color: powderblue;} h1 {color: blue;} </style> </head> <body> </body> </html> p {color: red;} <h1>this is a heading</h1> <p>this is a paragraph.</p> HTML Session 2 14

External CSS An external style sheet is used to define the style for many HTML pages. With an external style sheet, you can change the look of an entire web site, by changing one file! To use an external style sheet, add a link to it in the <head> section of the HTML page: <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="styles.css"> </head> <body> <h1>this is a heading</h1> <p>this is a paragraph.</p> </body> </html> HTML Session 2 15

External CSS An external style sheet can be written in any text editor. The file must not contain any HTML code, and must be saved with a.css extension. Here is how the "styles.css" looks: body { background-color: powderblue; } h1 { color: blue; } p { color: red; } HTML Session 2 16

CSS Fonts The CSS color property defines the text color to be used. The CSS font-family property defines the font to be used. The CSS font-size property defines the text size to be used. <style> h1 { color: blue; font-family: verdana; font-size: 300%; } p { color: red; font-family: courier; font-size: 160%; } </style> HTML Session 2 17

CSS Border The CSS border property defines a border around an HTML element: p { border: 1px solid powderblue; } HTML Session 2 18

CSS Padding The CSS padding property defines a padding (space) between the text and the border p { border: 1px solid powderblue; padding: 30px; } HTML Session 2 19

CSS Margin The CSS margin property defines a margin (space) outside the border p { border: 1px solid powderblue; margin: 50px; } HTML Session 2 20

The id Attribute To define a specific style for one special element, add an id attribute to the element #p01 { color: blue; } <p id="p01">i am different</p> HTML Session 2 21

The class Attribute To define a style for a special type of elements, add a class attribute to the element <p class="error">i am different</p> p.error { color: red; } HTML Session 2 22

External References External style sheets can be referenced with a full URL or with a path relative to the current web page. This example uses a full URL to link to a style sheet: <link rel="stylesheet" href="https://www.w3schools.com/html/styles.css"> <link rel="stylesheet" href="/html/styles.css"> HTML Session 2 23

Chapter Summary Use the HTML style attribute for inline styling Use the HTML <style> element to define internal CSS Use the HTML <link> element to refer to an external CSS file Use the HTML <head> element to store <style> and <link> elements Use the CSS color property for text colors Use the CSS font-family property for text fonts Use the CSS font-size property for text sizes Use the CSS border property for borders Use the CSS padding property for space inside the border Use the CSS margin property for space outside the border HTML Session 2 24

HTML Links HTML links are hyperlinks. You can click on a link and jump to another document. When you move the mouse over a link, the mouse arrow will turn into a little hand. In HTML, links are defined with the <a> tag: <a href="url">link text</a <a href="https://www.w3schools.com/html/">visit our HTML tutorial</a> HTML Session 2 25

HTML Links Local Links The example above used an absolute URL (A full web address). A local link (link to the same web site) is specified with a relative URL (without http://www...). <a href="html_images.asp">html Images</a> HTML Session 2 26

HTML Link Colors By default, a link will appear like this (in all browsers): 1. An unvisited link is underlined and blue 2. A visited link is underlined and purple 3. An active link is underlined and red You can change the default colors, by using styles: <style> a:link {color:green; background-color:transparent; text-decoration:none} a:visited {color:pink; background-color:transparent; text-decoration:none} a:hover {color:red; background-color:transparent; text-decoration:underline} a:active {color:yellow; background-color:transparent; text-decoration:underline} </style> HTML Session 2 27

HTML Links - The target Attribute The target attribute specifies where to open the linked document. The target attribute can have one of the following values: 1. _blank - Opens the linked document in a new window or tab 2. _self - Opens the linked document in the same window/tab as it was clicked (this is default) 3. _parent - Opens the linked document in the parent frame 4. _top - Opens the linked document in the full body of the window 5. framename - Opens the linked document in a named frame HTML Session 2 28

HTML Links - Image as Link It is common to use images as links <a href="default.asp"> <img src="smiley.gif" alt="html tutorial" style="width:42px;height:42px;border:0;"> </a> HTML Session 2 29

HTML Links - Create a Bookmark 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. <h2 id="tips">useful Tips Section</h2> <a href="#tips">visit the Useful Tips Section</a> <a href="html_tips.html#tips">visit the Useful Tips Section</a> HTML Session 2 30

Chapter Summary Use the <a> element to define a link Use the href attribute to define the link address Use the target attribute to define where to open the linked document Use the <img> element (inside <a>) to use an image as a link Use the id attribute (id="value") to define bookmarks in a page Use the href attribute (href="#value") to link to the bookmark HTML Session 2 31

HTML Images In HTML, images are defined with the <img> tag. The <img> tag is empty, it contains attributes only, and does not have a closing tag. The src attribute specifies the URL (web address) of the image: <img src="url" alt="some_text" style="width:width;height:height;"> HTML Session 2 32

HTML Images The alt Attribute The alt attribute provides an alternate text for an image, if the user for some reason cannot view it (because of slow connection, an error in the src attribute, or if the user uses a screen reader). If a browser cannot find an image, it will display the value of the alt attribute: HTML Session 2 33

HTML Images Images in Another Folder If not specified, the browser expects to find the image in the same folder as the web page. However, it is common to store images in a sub-folder. You must then include the folder name in the src attribute: <img src="/images/html5.gif" alt="html5 Icon" style="width:128px;height:128px;"> HTML Session 2 34

HTML Images Image Floating Use the CSS float property to let the image float to the right or to the left of a text: <p><img src="smiley.gif" alt="smiley face" style="float:right;width:42px;height:42px;"> The image will float to the right of the text.</p> <p><img src="smiley.gif" alt="smiley face" style="float:left;width:42px;height:42px;"> The image will float to the left of the text.</p> HTML Session 2 35

HTML Images Image Maps Use the <map> tag to define an image-map. An image-map is an image with clickable areas. The name attribute of the <map> tag is associated with the <img>'s usemap attribute and creates a relationship between the image and the map. The <map> tag contains a number of <area> tags, that defines the clickable areas in the image-map: <img src="planets.gif" alt="planets" usemap="#planetmap" style="width:145px;height:126px;"> <map name="planetmap"> <area shape="rect" coords="0,0,82,126" alt="sun" href="sun.htm"> <area shape="circle" coords="90,58,3" alt="mercury" href="mercur.htm"> <area shape="circle" coords="124,58,8" alt="venus" href="venus.htm"> </map> HTML Session 2 36

Chapter Summary Use the HTML <img> element to define an image Use the HTML src attribute to define the URL of the image Use the HTML alt attribute to define an alternate text for an image, if it cannot be displayed Use the HTML width and height attributes to define the size of the image Use the CSS width and height properties to define the size of the image (alternatively) Use the CSS float property to let the image float Use the HTML <map> element to define an image-map Use the HTML <area> element to define the clickable areas in the image-map Use the HTML <img>'s element usemap attribute to point to an image-map HTML Session 2 37

HTML Session 2 38