IDK 0040 Vrgurakendused I harjutus 01 Introduction Deniss

  • Slides: 10
Download presentation
IDK 0040 Võrgurakendused I harjutus 01: Introduction Deniss Kumlander

IDK 0040 Võrgurakendused I harjutus 01: Introduction Deniss Kumlander

Info • http: //www. w 3 schools. com/ Lisa: • http: //www. ttu. ee/it/vorgutarkvara/wav

Info • http: //www. w 3 schools. com/ Lisa: • http: //www. ttu. ee/it/vorgutarkvara/wav 3080 • http: //philip. greenspun. com/seia/

HTML Tags • • • HTML tags are used to mark-up HTML elements HTML

HTML Tags • • • HTML tags are used to mark-up HTML elements HTML tags are surrounded by the two characters < and > The surrounding characters are called angle brackets HTML tags normally come in pairs like <b> and </b> The first tag in a pair is the start tag, the second tag is the end tag The text between the start and end tags is the element content : it can be a text or a set of other html elements • HTML tags are not case sensitive, <b> means the same as <B> • At the same time we should use the lower case to meet standards! • Besides we will agree to have a “well-formed” document i. e – Close tags in the reverse order to opening • For example if we start <b><i> then we should end </i></b> (not </b></i>) – Always close tags

<html> <head> <title>Help desk</title> </head> <body> My computer just told me that I had

<html> <head> <title>Help desk</title> </head> <body> My computer just told me that I had completed an illegal operation, and I'm not even a doctor. </body> </html>

HTML Attributes • Tags can have attributes, which provides extra information about how the

HTML Attributes • Tags can have attributes, which provides extra information about how the tag (HTML element) behaves/displays etc. on the page. • For example we can add into the body tag an attribute specifying that the background color of the body (i. e. document in web browser) should we red: – <body bgcolor="red">. • Attributes always come in name/value pairs like this: name="value". • Attributes are always added to the start tag of an HTML element.

Quote Styles, "red" or 'red'? • Attribute values should always be enclosed in quotes.

Quote Styles, "red" or 'red'? • Attribute values should always be enclosed in quotes. Double style quotes are the most common, but single style quotes are also allowed. • In some rare situations, like when the attribute value itself contains quotes, it is necessary to use single quotes: – name='John "Shot. Gun" Nelson'

BODY Attributes • <body bgcolor="#CCFFCC"> • <body background=“abc. gif"> • <body bgproperties=“FIXED” >

BODY Attributes • <body bgcolor="#CCFFCC"> • <body background=“abc. gif"> • <body bgproperties=“FIXED” >

Headings • Headings are defined with the <h 1> to <h 6> tags. <h

Headings • Headings are defined with the <h 1> to <h 6> tags. <h 1> defines the largest heading. <h 6> defines the smallest heading. <h 1>This is a heading</h 1> HTML automatically <h 2>This is a heading</h 2> adds an extra <h 3>This is a heading</h 3> blank line <h 4>This is a heading</h 4> before and <h 5>This is a heading</h 5> after a heading. <h 6>This is a heading</h 6>

Some more • Paragraphs – Paragraphs are defined with the <p> tag. – <p>This

Some more • Paragraphs – Paragraphs are defined with the <p> tag. – <p>This is a paragraph</p> • Line Breaks – The tag is used when you want to end a line, but don't want to start a new paragraph. • Comments <!-- This is a comment --> For example you can comment out some html parts (here a paragraph) <!--p>Text is here</p-->

Useful Tips • When you write HTML text, you can never be sure how

Useful Tips • When you write HTML text, you can never be sure how the text is displayed in another browser. Some people have large computer displays, some have small… • HTML will truncate the spaces in your text. Any number of spaces count as one. – Therefore you can have a “visual structure” inside html doc using tabs etc: <html> <body> </html> Web browser see: <html><body></html> • Using empty paragraphs <p> to insert blank lines is a bad habit. Use the tag instead. • You might have noticed that paragraphs can be written without the closing tag </p>. Don't rely on it. The next version of HTML will not allow you to skip ANY closing tags.