• Nie Znaleziono Wyników

Web browser

N/A
N/A
Protected

Academic year: 2021

Share "Web browser"

Copied!
15
0
0

Pełen tekst

(1)

HTML – part I

Maciej Grzenda, PhD

Warsaw University of Technology

Faculty of Mathematics and Information Science M.Grzenda@mini.pw.edu.pl

http://www.mini.pw.edu.pl/~grzendam

(2)

Web systems - introduction

Web server

1. request is sent

2. Document is read

Web browser

1. request is sent is read

3. Response (the document content or error) is received

0. the user wants to display a document

4. Response (e.g. a web page) is displayed to the user

In this case we assume that all the documents are static i.e. a priori prepared as files on a disk

The most important documents are HTML documents

(3)

Web systems – first labs

Web browser

1. A user wants to display a document

The HTML documents will be placed on a local disk and opened with File/Open file… rather than

2. The document is read

3. Response (e.g. a web page) is displayed to the user

Both HTML documents stored locally and accessed via HTTP are parsed and displayed in the same way.

with File/Open file… rather than by typing in the address of the web site

(4)

HTML tasks

• In this task and all the other

HTML/CSS/JavaScript tasks use any text editor you prefer, if possible with syntax highlighting feature such as Notepad++

highlighting feature such as Notepad++

• Verify whether your document is compliant with HTML standard and fix errors, if

necessary

(5)

Task 1 – first HTML document

Develop a web site similar to this one:

(6)

Task 1 – text content

Resources for Web Programming course

Resources for browser-side programming include both books and web resources. HTML - Hypertext Markup Language is a language used to define portable documents.

HTML documents that can be properly displayed on any operating system, in any browser (also text-based and mobile browsers).

Documents require web browser to be displayed to the user.

Books

Deitel, P.J., JavaScript for Programmers, Pearson Education, 2010

Lemay L. and Colburn R., Sams Teach Yourself Web Publishing with HTML & XHTML in 21 Days (4th Edition), 2003

Schafer S.M., HTML, XHTML, and CSS Bible, Wiley Publishing, 2010 (also: HTML, XHTML i CSS, Helion, 2011)

Schultz D., Cook C., Beginning HTML with CSS and XHTML: Modern Guide and Reference, Apress, 2007 (also: HTML, XHTML i CSS. Nowoczesne tworzenie stron WWW, Helion, 2008)

Zeldman J., Marcotte E., Designing with Web Standards. Third Edition, Pearson Education, 2010

Web resources 1. www.w3.org

2. www.w3schools.com 3. www.theserverside.com

4. www.javapassion.com This text can be used to develop your first document.

(7)

Task 1 – things to do

1. Develop your HTML document using lecture content and HTML reference available at

http://www.w3schools.com 2. Validate your document at 2. Validate your document at

http://validator.w3.org/check

3. If necessary use tidy to fix your document automatically at

http://infohound.net/tidy/tidy.pl

(8)

Task 1 – sample document to start from

Document type declaration Character encoding

Header Link to

another part of the same document Header (1st level)

End of line

(9)

Task 2 - images

Develop a web site similar to this one. Use IMG tag with different settings. Refer to

http://www.w3schols.com for a list of mandatory attributes.

(10)

Image maps

1. Different active regions can be defined within a picture.

2. They can be: rectangles, circles and polygons

3. A link is defined for every region.

4. When a user clicks somewhere in the (0,0)

4. When a user clicks somewhere in the region, a corresponding link is

activated, as with regular A links.

5. Coordinates of the regions are defined in pixels

6. More than one region with the same shape type (but not coordinates) is allowed.

7. A polygon can be used to approximate any shape other than a rectangle and a circle.

(11)

Image maps - details

<p>

<img

src="http://www.mini.pw.edu.pl/tikiwiki/images/m_logo.gif"

usemap="#first" alt="logo" width="150">

A picture with a reference to a map

(x,y,radius)

<map name="first" id="first">

<area shape="circle" coords="10,10,20"

href="http://www.oracle.com" alt="Oracle">

<area shape="rect" coords="100,100,120,150"

href="http://www.microsoft.com" alt="Microsoft">

<area shape="poly" coords="20,40,80,30,100,90"

href="http://www.w3.org" alt="Web Consortium">

</map>

</p>

(x,y,radius)

Polygon defined by (x1,y1,x2,y2,…)

Coordinates of

opposite corners

(12)

Task 3 – image maps

Develop an image map with the following layout of

active regions:

(13)

Task 4 - tables

Base cells can be merged.

Any content can be placed

inside incl. another table.

(14)

Task 5 - tables

Develop a web site similar to this one.

Link to the first document (result of task 1) placed on a picture

Hint: use embedded table and entity references

Link to first document

(result of task 1) placed

on this text

(15)

Task 6 – other text formatting tags

• Develop a web site using PRE, BLOCKQUOTE, CITE, Q, INS, DEL, SUP, SUB,…

• Use any content you want to display:

– A few lines of Java code, – Citation,

– Upper and lower indexes in mathematical formulas,

– …

Cytaty

Powiązane dokumenty

Aby wykonać akapit wystraczy u mieścić tekst między znacznikami &lt;p&gt;Jakiś tekst &lt;p/&gt; Akapit można wyrównywać do prawej, lewej krawędzi, wyśrodkować oraz

• Document Object Model Level 2 Events (add/removeEventListener).. • Creating and changing the styles on

• jQuery speeds up writing the code and provides universal API for all browsers. • plain JavaScript code will always be faster (if

• The current idea are Single Page Applications consisting of HTML/CSS layout utilized by JavaScript application with content provided from REST services in a form of JSON

• With AJAX, we are taking a bunch of dusty old technologies and stretching them well beyond their original scope – AJAX in Action, Manning, 2006. Michał

• Powyższy przykład deklaruje element opis o zawartości tekstowej, posiadający 2 atrybuty – id typu ID (unikalny identyfikator) oraz autor typu tekstowego... XML 3 –

eXtensible Markup

• Definicje typów mogą wystąpić globalnie (z atrybutem name) albo wewnątrz deklaracji opisywanego elementu (anonimowo, celem