Web Programming HTML
Web Programming HTML
HTML
CSS JavaScript
Chrome
Internet Explorer
Opera
Safari
Firefox
The Web Programming Triangle
Web
Programming
CSS JavaScript
Use CSS to specify the layout of web pages Use JavaScript to program
the behavior of web pages
Basic Web Programming
• HTML
• CSS
• JavaScript
Server
Web
JavaScript
Web Architecture
Web Browser
Client
Web Server
Client-Server Example
Client
Web Browser
Response
Web Server
Request
Database
The code runs on the server and converted to Web Page (HTML)
HTML before sending to client (Web Browser)
1
3
HTML Editors
Professional HTML editors:
• Adobe Dreamweaver
• CoffeeCup HTML Editor
• Notpad++,……..
For the simple examples in this Tutorial we only
need Notepad (Windows)
What Are HTML Tags?
<!DOCTYPE html>
<html>
HTML
<head>
<title> This is document title </title>
</head>
<body>
<h1> This is a heading </h1>
<p> Hello World! </p>
</body>
</html>
Web Browser
HTML Page Structure
<!DOCTYPE html>
<html>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
<p>This is another
paragraph.</p>
</body>
</html>
1
5
My First HTML Web Page
<tagname>content</tagname>
</body>
</html>
In HTML, headings are written in the following elements:
•<h1>
•<h2>
•<h3>
•<h4>
•<h5>
•<h6>
As you might have guessed <h1> and <h2> should be used for the most
important titles, while the remaining tags should be used for sub-headings
and less important text.
HTML Tags
Hyperlink:
<a href="http://www.google.com">This is a link to Google</a>
Bold Text:
Paragraph:
<b>This is my Text</b >
<p>My first paragraph.</p>
Headers:
Line Break:
<h1>This is my Header</h1>
This is my Text
<h2>This is my Header</h2> < br >
<h3>This is my Header</h3> This is also my Text
Title : Comments:
<title>This is my Title</title >
<!-- Write your comments here -->
Image:
<img src=“myimage.jpg" alt=”blabla" width="104" height="142">
<!DOCTYPE html>
<html>
<body>
Hyperlinks
<h1>This is a heading</h1>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h1>This is a heading</h1>
Images
<pre>
Text in a pre element is displayed in a fixed-width
font, and it preserves both spaces and line breaks
</pre>
HTML <meta> Tag
• <meta> tags always go inside the <head> element, and are typically used
to specify character set, page description, keywords, author of the
document, and viewport settings.
<head>
<meta charset="UTF-8">
<meta name="description" content="Free Web tutorials">
<meta name="keywords" content="HTML, CSS, JavaScript">
<meta name="author" content="John Doe">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
Attributes:
• You should include the following <meta> element in all your web
pages:
• 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.
HTML block level and inline elements
• P <p></p>
• h1, h2, h3, h4, h5, h6
• ol, ul
• pre
• address
• blockquote
• dl
• div
• fieldset
• form
• hr
• noscript
• table
Example of block level elements:
1. HTML inline level elements can appear in the body of an HTML page.
2. It can contain data and other inline elements.
3. By default, inline elements do not begin on new lines.
4. inline elements create shorter structures (than block level elements).
List of inline elements
• b, big, i, small, tt
• abbr, acronym, cite, code, dfn, em, kbd, strong, samp, var
• a, bdo, br, img, map, object, q, script, span, sub, sup
• button, input, label, select, textarea
Example of inline elements:
The result
HTML <blockquote> Tag
The <blockquote> tag specifies a section that is quoted from another source.
Editing Elements
• The nearest parent of the <dfn> tag must also contain the
definition/explanation for the term.
The <abbr> tag defines an abbreviation or an acronym, like
"HTML", "CSS", "Mr.", "Dr.", "ASAP", "ATM".
sub, sup, s, mark, and small Elements
• The <sub> tag is used to add a subscript text to the HTML document.
The <sub> tag defines the subscript text. Subscript text appears half a
character below the normal line and is sometimes rendered in a
smaller font. Subscript text can be used for chemical formulas, like H2O
to be written as H2O.
• The <sup> tag is used to add a superscript text to the HTML document.
The <sup> tag defines the superscript text. Superscript text appears half
a character above the normal line and is sometimes rendered in a
smaller font. Superscript text can be used for footnotes.
The <s> element renders text with a strikethrough, or a line through it.
The <mark> element represents text which
is marked or highlighted for reference or notation purposes, due to
the marked passage's relevance or importance in the enclosing
context.
The <small> element represents side-comments and small print
strong, em, b, u, and i Elements
The <strong> element indicates that its contents have strong
importance
• The <em> element marks text that has stress emphasis.
The <em> element can be nested, with each level of nesting
indicating a greater degree of emphasis.
The <u> element represents a span of inline text which should be
rendered in a way that indicates that it has a non-textual annotation.
This is rendered by default as a simple solid underline
The <i> element these have been presented using italicized type,
which is the original source of the <i> naming of this element.
span Element
The <span> element is a generic inline container for phrasing
content, which does not inherently represent anything. It can be
used to group elements for styling purposes