Web and Apps 1) HTML - CSS

Similar documents
Html basics Course Outline

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

Introduction to WEB PROGRAMMING

HTTP and HTML. We will use HTML as a frontend to our webapplications, therefore a basic knowledge of HTML is required, especially in forms.

CSS: The Basics CISC 282 September 20, 2014

Programmazione Web a.a. 2017/2018 HTML5

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

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

Appendix D CSS Properties and Values

ICT IGCSE Practical Revision Presentation Web Authoring

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

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

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6

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

Session 4. Style Sheets (CSS) Reading & References. A reference containing tables of CSS properties

Adding CSS to your HTML

HTMLnotesS15.notebook. January 25, 2015

HTML. HTML Evolution

COSC 2206 Internet Tools. CSS Cascading Style Sheets

Creating Web Pages. Getting Started

recall: a Web page is a text document that contains additional formatting information in the HyperText Markup Language (HTML)

Basic CSS Lecture 17

HTML & CSS November 19, 2014

CSC 121 Computers and Scientific Thinking

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

- The CSS1 specification was developed in CSS2 was released in CSS2.1 reflects browser implementations

CASCADING STYLE SHEETS (CSS) BY: RIHAM ALSMARI, PNU. Lab 4

Hyper Text Markup Language HTML: A Tutorial

CS105 Course Reader Appendix A: HTML Reference

Introduction to Web Tech and Programming

HTML/XML. HTML Continued Introduction to CSS

Introduction to Multimedia. MMP100 Spring 2016 thiserichagan.com/mmp100

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

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

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

KillTest *KIJGT 3WCNKV[ $GVVGT 5GTXKEG Q&A NZZV ]]] QORRZKYZ IUS =K ULLKX LXKK [VJGZK YKX\OIK LUX UTK _KGX

Modify cmp.htm, contactme.htm and create scheduleme.htm

Lecture : 3. Practical : 2. Course Credit. Tutorial : 0. Total : 5. Course Learning Outcomes

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

A Balanced Introduction to Computer Science, 3/E

By completing this practical, the students will learn how to accomplish the following tasks:

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

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

The building block of a CSS stylesheet. A rule consists of a selector and a declaration block (one or more declarations).

CSS: Cascading Style Sheets

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

ITNP43: HTML Lecture 4

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

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

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

Final Exam Study Guide

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

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

week8 Tommy MacWilliam week8 October 31, 2011

Reading 2.2 Cascading Style Sheets

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

HTML Tags <A></A> <A HREF=" CNN </A> HREF

Document Object Model. Overview

Advanced Web Programming C2. Basic Web Technologies

Module 2 (VI): CSS [Part 3]

1 of 7 11/12/2009 9:29 AM

CASCADING STYLESHEETS

Introduction to Web Technologies

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) Learning Objectives (2 of 2)

Bixby Public Schools Course Essential Elements Grade: Desktop Publishing

CSS is applied to an existing HTML web document--both working in tandem to display web pages.

3.1 Introduction. 3.2 Levels of Style Sheets. - HTML is primarily concerned with content, rather than style. - There are three levels of style sheets

UNIVERSITI TEKNOLOGI MALAYSIA TEST 1 SEMESTER II 2012/2013

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

Index. CSS directive, # (octothorpe), intrapage links, 26

CSS. Lecture 16 COMPSCI 111/111G SS 2018

<style type="text/css"> <!-- body {font-family: Verdana, Arial, sans-serif} ***set font family for entire Web page***

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

introduction to XHTML

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

ICT IGCSE Practical Revision Presentation Web Authoring

Page Layout Using Tables

- The CSS1 specification was developed in CSSs provide the means to control and change presentation of HTML documents

Activity 4.1: Creating a new Cascading Style Sheet

- HTML is primarily concerned with content, rather than style. - However, tags have presentation properties, for which browsers have default values

Lab Introduction to Cascading Style Sheets

ACSC 231 Internet Technologies

1.264 Lecture 12. HTML Introduction to FrontPage

Creating Web Pages with SeaMonkey Composer

CSS Lecture 16 COMPSCI 111/111G SS 2018

Text and Layout. Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 11. This presentation 2004, MacAvon Media Productions

Deccansoft Software Services

COMS 359: Interactive Media

Web Design and Development ACS-1809

HTML + CSS. ScottyLabs WDW. Overview HTML Tags CSS Properties Resources

HTML and CSS COURSE SYLLABUS

CS 1100: Web Development: Client Side Coding / Fall 2016 Lab 2: More HTML and CSS

Using CSS in Web Site Design

CASCADING STYLE SHEET CSS

HTML and CSS: An Introduction

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

GRAPHIC WEB DESIGNER PROGRAM

To illustrate how to set TAG styles the <body> and <h1> tags (for the BODY and the HEADING 1 styles) will be adjusted.

CS144 Notes: Web Standards

IMY 110 Theme 7 HTML Tables

Transcription:

Web and Apps 1) HTML - CSS Emmanuel Benoist Spring Term 2017 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 1

HyperText Markup Language and Cascading Style Sheets Introduction Forms and Input Tables Headings and Styles Sheets CSS Basic formating Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 2

Introduction Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 3

HTML is a Markup Language Tags: A command can be composed of two tags: <h1> and </h1> Or one single tag: <img src="blank.gif"> XHTML Syntax: In XHTML (like in any XML), tags must be written in lower case, they must always terminate, arguments must be enclosed in " Single tags must be written like: <br /> (self closing). Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 4

Structure of an HTML document HTML Structure <html> <head>... </head> <body>...</body> </html> Content of the head: Meta-information Title, Author, Keywords, Abstract, Javascript and CSS files Content of the body: Information to be displayed Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 5

Optimize Header Content Title: Appears in the window status bar Keywords can be used by search engines and robots RSS feeds will be used by aggregators (or browsers) <head> <meta http equiv= content type content= text/html;charset=iso 8859 1 > <title>letemps.ch</title> <link href= letemps.css type= text/css rel= stylesheet > <link rel= alternate type= application/rss+xml title= Le Temps Infos href= http://www.letemps.ch/rss.asp /> <link rel= alternate type= application/rss+xml title= Le Temps Sommaire href= http://www.letemps.ch//rss/sommaire.asp /> <link rel= SHORTCUT ICON HREF= http://www.letemps.ch/favicon. ico > <script language= javascript type= text/javascript >...</script> </head> Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 6

Content of the Body Everything that needs to be displayed (almost everything) Headings, paragraphes, texts, images, tables, The basic Document Object Model (DOM) Represents a tree, each tag (pair) is a node, texts are leaves. This Tree can be manipulated in Javascript (deletion, insertion or modification of nodes), Contains place holders (not displayed unless activated by javascript) Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 7

Forms and Input Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 8

Forms and Input Input Fields have to be incorporated in a form tag A Form has: a method (GET or POST) an id (to be manipulated by javascript), an action (where to send the request). Input fields Hidden: are not viewable (neither modifiable normally) Text: To input text on one line Password: to input text that can not be displayed (*****) Radiobuttons: choose one button from a list (enabling one disable the others) Checkbox: Can be checked or unchecked (independently). Other Fields Selection Box (select one amoung many) Textarea: Type any text (more than one line) Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 9

Example <form method= GET action= forms.php > There is here a hidden input, which is not displayed: <input type= hidden name= somethingsecret value= yes /> Input type text: <input type= text name= textfield1 value= 1 size= 9 /> Input type password: <input type= password name= pwdfield1 value= 123 /> Input type Radiobutton: 1:<input type= radio name= radio1 value= 1 checked= true /> 2:<input type= radio name= radio1 value= 2 /> 3:<input type= radio name= radio1 value= 3 /> Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 10

Example (Cont.) Selection Box: <select name= selectionfield1 > <option value= 7 >Tous</option> <option value= 1 >Gare/Arrêt</option> <option value= 2 >Lieu,rue,numéro</option> <option value= 4 >Tourisme</option> </select> Another Select (in a scrolling list) <select name= select2 size= 5 > <option value= 6 >Auto</option> <option value= 3 >Autor</option>... </select> A multi-select (all the values are transfered to the server) <select multiple= 1 name= multiselect size= 3 > <option value= Less than 1 year. >Less than 1 year.</option> <option value= 1 5 years. >1 5 years.</option> Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 11

Example (Cont.) Textarea <textarea name= textareafield > This is the default value </textarea> Buttons (for Javascript) and submit (to send the request) <input type= button value= test name= btn1 /> <input type= submit value= OK name= send /> Image (the coordinates of the click are sent) <input type= image src= imagemap.gif name= image > Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 12

Tables Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 13

Tables A table contains rows and columns Two sort of rows: Headers <th> and normal rows <tr> Data are stored in columns: <td> Standard table <table> <tr><th>year</th><th>warmest Month</th><th>Temp.</th> </tr> <tr><td>2006</td><td>june</td><td>24</td></tr> <tr><td>2007</td><td>august</td><td>27</td></tr> <tr><td>2008</td><td>july</td><td>31</td></tr> <tr><td>2009</td><td>june</td><td>29</td></tr> </table> Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 14

Tables Cont. One can merge cells colspann merges the cells on multiple columns rowspann merges the cells on multiple lines <table> <tr><th> </th><th colspan= 2 >Result</th></tr> <tr><th>year</th><th>warmest Month</th><th>Temp.</th> </tr> <tr><td rowspan= 2 >2006</td><td>June</td><td>27</td> </tr> <tr><td>august</td><td>27</td></tr> <tr><td>2007</td><td>july</td><td>31</td></tr> <tr><td>2008</td><td>june</td><td>29</td></tr> </table> Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 15

Table with CSS One can define classes in a table <table class= colored > <tr><th> </th><th colspan= 2 >Result</th></tr> <tr><th>year</th><th>warmest Month</th><th>Temp.</th> </tr> <tr><td rowspan= 2 >2006</td><td>June</td><td>27</td> </tr> <tr><td>august</td><td>27</td></tr> <tr><td>2007</td><td>july</td><td class= red >31</td></ tr> <tr><td>2008</td><td>june</td><td>29</td></tr> </table> Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 16

Headings and Styles Sheets Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 17

Headings Headings h? are used to display titles, subtitles,... <h1>heading level 1</h1> <h2>heading level 2</h2> <p>...</p> <h3>heading level 3</h3> <p>...</p> <h2>heading level2 class second </h2> Style may be given in a style sheet. We need to import the style file (in the HTML head for instance): <link rel= stylesheet href= heading.css type= text/css /> We can define properties for some tags body { font family: helvetica, arial, sans serif; } h1 {color:red} h2 {color:blue} Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 18

CSS Basic formating Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 19

Classes for Style Sheets One want to select some h1 or some h2, without defining the same for h1. We add a class to the tag <h2 class= second >Heading level2 class second </h2> <p>... </p> <h3 class= second >heading level 3</h3> <p>... </p> <h3 class= third >heading level 3</h3> we can define some properties for the different classes: h2.second {color:#f0c000} h3.second {color:#907000} h3.third {color:#302500} Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 20

What sort of properties can we define? Background proerties Color image Reapeat or not Its place and the way it is defined <head>... <style type= text/css > body { background: #00ff00 url( smiley.gif ) no repeat fixed center; }.leftmenu servicebutton ACT { background image: url(bg menubutton18h.gif); color: #003366; background color: #dedcbd } </style> </head> Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 21

Text formating Font color definition.green {color: #00ff00}.violet {color: #dda0dd}.blue {color: rgb(0,0,255)} Text align h1.center {text align: center} h1.left {text align: left} h1.right {text align: right} Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 22

Text Transformations Upper/lowercases p.uppercase {text transform: uppercase} p.lowercase {text transform: lowercase} p.capitalize {text transform: capitalize} Lines (over, through, or under).overline {text decoration: overline}.linethrough {text decoration: line through}.underline {text decoration: underline} Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 23

Font definition Font Font Familly (we should give many, such that one is installed on the client). Font-Size Font-weight (how bold it is)... p.font { font: italic small caps 900 12px arial } td { font size: 11px; margin: 0px; color: #000000; font family: Verdana, Geneva, Arial, Helvetica, sans serif} input { font size: 11px; margin: 0px; color: #000000; font family: Verdana, Geneva, Arial, Helvetica, sans serif} Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 24

Paragraph surrondings Margins p.margin {margin: 2cm 4cm 3cm 4cm} Border p.border { border: medium double rgb(250,0,255) } Padding td.test1 {padding: 1.5cm} td.test2 {padding: 0.5cm 2.5cm} Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 25

Boxes configuration Padding and margins h1 { padding right: 2px; margin top: 0px; padding left: 0px; font weight: bold; font size: 17px; margin bottom: 9px; color: #003366; padding top: 0px; background color: #dcedff } h2 { padding right: 2px; margin top: 4px; padding left: 0px; font weight: bold; font size: 14px; margin bottom: 6px; color: #7079aa; padding top: 0px; background color: #dcedff } h3 { padding right: 2px; margin top: 12px; padding left: 0px; margin bottom: 2px; padding top: 0px; } Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 26

List Style We can use any image as a line start in a unordered list (ul) <style type= text/css > ul { list style: square inside url( arrow.gif ) } </style> <ul> <li>coffee</li> <li>tea</li> <li>coca Cola</li> </ul> Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 27

Conclusion This was just an introduction HTML is much more than 5 tags CSS is not just formating of text and colors Next week you have to follow the CSS tutorial by W3schools Principles HTML defines the content, without being interested in layout CSS defines the layout HTML may work with different CSS (for different media for instance) Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 28