Database System Html Basics Complete Topic.pptx

rockysaad553 16 views 47 slides Jun 26, 2024
Slide 1
Slide 1 of 47
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47

About This Presentation

Lab 09 Database System.pptx


Slide Content

HTML Basics HTML, Text, Images, Tables 6/6/2024 1

Table of Contents Introduction to HTML How the Web Works? What is a Web Page? My First HTML Page Basic Tags: Hyperlinks, Images, Formatting Headings and Paragraphs HTML in Details The <!DOCTYPE> Declaration The <head> Section: Title , Meta , Script , Style 6/6/2024 2

Table of Contents HTML in Details The <body> Section Text Styling and Formatting Tags Hyperlinks: <a> , Hyperlinks and Sections Images: < img > Lists: < ol >, < ul > and <dl> The <div> and <span> elements HTML Tables HTML Forms 3 6/6/2024 3

How the Web Works? WWW use classical client / server architecture HTTP is text-based request-response protocol Page request Client running a Web Browser Server running Web Server Software ( e.g Apache) Server response HTTP HTTP 6/6/2024 4

What is a Web Page? Web pages are text files containing HTML HTML – H yper T ext M arkup L anguage The markup tags provide information about the page content structure 6/6/2024 5

Creating HTML Pages An HTML file must have.html file extension HTML files can be created with text editors: NotePad Sublime Or HTML editors (WYSIWYG Editors): Microsoft FrontPage Macromedia Dreamweaver Visual Studio 6/6/2024 6

HTML Basics Text, Images, Tables, Forms 6/6/2024 7

HTML Structure HTML is comprised of “tags” Begins with <html> and ends with </html> Elements (tags) are nested one inside another: Tags have attributes: HTML describes structure using two main sections: <head> and <body> <html> <head></head> <body></body> </html> <img src="logo.jpg" alt="logo" /> 6/6/2024 8

First HTML Page <!DOCTYPE HTML> <html> <head> <title>My First HTML Page</title> </head> <body> <p>This is some text...</p> </body> </html> test.html 6/6/2024 9

<!DOCTYPE HTML> <html> <head> <title>My First HTML Page</title> </head> <body> <p>This is some text...</p> </body> </html> First HTML Page: Tags Opening tag Closing tag An HTML element consists of an opening tag, a closing tag and the content inside. 6/6/2024 10

<!DOCTYPE HTML> <html> <head> <title>My First HTML Page</title> </head> <body> <p>This is some text...</p> </body> </html> First HTML Page: Header HTML header 6/6/2024 11

<!DOCTYPE HTML> <html> <head> <title>My First HTML Page</title> </head> <body> <p>This is some text...</p> </body> </html> First HTML Page: Body HTML body 6/6/2024 12

Some Simple Tags Hyperlink Tags Image Tags Text formatting tags <a href="https://www.google.com" title="Telerik">Link to Telerik Web site</a> <img src="logo.gif" alt="logo" /> This text is <em>emphasized.</em> <br />new line<br /> This one is <strong>more emphasized.</strong> 6/6/2024 13

Some Simple Tags – Example <!DOCTYPE HTML> <html> <head> <title> Simple Tags Demo</title> </head> <body> <a href="http://www.google.com/" title= "Telerik site">This is a link.</a> <br /> <img src="logo.gif" alt="logo" /> <br /> <strong>Bold</strong> and <em>italic</em> text. </body> </html> some-tags.html 6/6/2024 14

Some Simple Tags – Example (2) <!DOCTYPE HTML> <html> <head> <title> Simple Tags Demo</title> </head> <body> <a href="http://www.telerik.com/" title= "Telerik site">This is a link.</a> <br /> <img src="logo.gif" alt="logo" /> <br /> <strong>Bold</strong> and <em>italic</em> text. </body> </html> some-tags.html 6/6/2024 15

Tags Attributes Tags can have attributes Attributes specify properties and behavior Attributes provide additional information about an element Attributes are always specified in the start tag Attributes come in name/value pairs like: name="value" Example : <img src="logo.gif" alt="logo" /> Attribute alt with value " logo " 6/6/2024 16

Headings and Paragraphs Heading Tags (h1 – h6) Paragraph Tags Sections: div and span <p>This is my first paragraph</p> <p>This is my second paragraph</p> <h1>Heading 1</h1> <h2>Sub heading 2</h2> <h3>Sub heading 3</h3> <div style="background: skyblue;"> This is a div</div> 6/6/2024 17

Headings and Paragraphs – Example <!DOCTYPE HTML> <html> <head><title>Headings and paragraphs</title></head> <body> <h1>Heading 1</h1> <h2>Sub heading 2</h2> <h3>Sub heading 3</h3> <p>This is my first paragraph</p> <p>This is my second paragraph</p> <div style="background:skyblue"> This is a div</div> </body> </html> headings.html 6/6/2024 18

<!DOCTYPE HTML> <html> <head><title>Headings and paragraphs</title></head> <body> <h1>Heading 1</h1> <h2>Sub heading 2</h2> <h3>Sub heading 3</h3> <p>This is my first paragraph</p> <p>This is my second paragraph</p> <div style="background:skyblue"> This is a div</div> </body> </html> Headings and Paragraphs – Example (2) headings.html 6/6/2024 19

Text Formatting Text formatting tags modify the text between the opening tag and the closing tag Ex. <b>Hello</b> makes “Hello” bold <b></b> bold <i></i> italicized <u></u> underlined <sup></sup> Sample superscript <sub></sub> Sample subscript <strong></strong> strong <pre></pre> Preformatted text <del></del> Deleted text – strike through 6/6/2024 20

Text Formatting – Example <html> <head> <title>Page Title</title> </head> <body> <h1>Notice</h1> <p>This is a <em>sample</em> Web page.</p> <p><pre>Next paragraph: preformatted.</pre></p> <h2>More Info</h2> <p>Specifically, we’re using XHMTL 1.0 transitional.<br /> Next line.</p> </body> </html> text-formatting.html 6/6/2024 21

Hyperlinks: <a> Tag Link to a document called form.html on the same server in the same directory: Link to a document called cat.html on the same server in the subdirectory stuff: <a href="form.html">Fill Our Form</a> <a href="stuff/cat.html">Catalog</a> 6/6/2024 22

Inserting an image with <img> tag: Image attributes: Example: Images: <img> tag src Location of image file (relative or absolute) alt Substitute text for display (e.g. in text mode) height Number of pixels of the height width Number of pixels of the width border Size of border, 0 for no border <img src="/img/basd-logo.png"> <img src="./php.png" alt="PHP Logo" /> 6/6/2024 23

Miscellaneous Tags – Example <html> <head> <title>Miscellaneous Tags Example</title> </head> <body> <hr size="5" width="70%" /> <center>Hello World!</center> <font size="3" color="blue">Font3</font> <font size="+4" color="blue">Font+4</font> </body> </html> misc.html 6/6/2024 24

Apple Orange Grapefruit Ordered Lists: <ol> Tag Create an O rdered L ist using <ol></ol> : Attribute values for type are 1 , A , a , I , or i Apple Orange Grapefruit Apple Orange Grapefruit Apple Orange Grapefruit Apple Orange Grapefruit <ol type="1"> <li>Apple</li> <li>Orange</li> <li> Grapefruit </li> </ol> 6/6/2024 25

Unordered Lists: < u l> Tag Create an U nordered L ist using <ul></ul> : Attribute values for type are: disc , circle or square Apple Orange Pear Apple Orange Pear Apple Orange Pear <ul type="disk"> <li>Apple</li> <li>Orange</li> <li> Grapefruit </li> </ul> 6/6/2024 26

Definition lists: <dl> tag Create definition lists using <dl> Pairs of text and associated definition; text is in <dt> tag, definition in <dd> tag Renders without bullets Definition is indented <dl> <dt>HTML</dt> <dd>A markup language …</dd> <dt>CSS</dt> <dd>Language used to …</dd> </dl> 6/6/2024 27

Lists – Example <ol type="1"> <li>Apple</li> <li>Orange</li> <li>Grapefruit</li> </ol> <ul type="disc"> <li>Apple</li> <li>Orange</li> <li>Grapefruit</li> </ul> <dl> <dt>HTML</dt> <dd>A markup lang…</dd> </dl> lists.html 6/6/2024 28

HTML Tables 6/6/2024 29

HTML Tables Tables represent tabular data A table consists of one or several rows Each row has one or more columns Tables comprised of several core tags: <table></table> : begin / end the table <tr></tr>: create a table row <td></td>: create tabular data (cell) 6/6/2024

HTML Tables (2) Start and end of a table Start and end of a row Start and end of a cell in a row 31 <table> ... </table> <tr> ... </tr> <td> ... </td> 6/6/2024

Simple HTML Tables – Example 32 <table cellspacing="0" cellpadding="5"> <tr> <td><img src="ppt.gif"></td> <td><a href="lecture1.ppt">Lecture 1</a></td> </tr> <tr> <td><img src="ppt.gif"></td> <td><a href="lecture2.ppt">Lecture 2</a></td> </tr> <tr> <td><img src="zip.gif"></td> <td><a href="lecture2-demos.zip"> Lecture 2 - Demos</a></td> </tr> </table> 6/6/2024

<table cellspacing="0" cellpadding="5"> <tr> <td><img src="ppt.gif"></td> <td><a href="lecture1.ppt">Lecture 1</a></td> </tr> <tr> <td><img src="ppt.gif"></td> <td><a href="lecture2.ppt">Lecture 2</a></td> </tr> <tr> <td><img src="zip.gif"></td> <td><a href="lecture2-demos.zip"> Lecture 2 - Demos</a></td> </tr> </table> Simple HTML Tables – Example (2) 33 6/6/2024

cellpadding Defines the empty space around the cell content cellspacing Defines the empty space between cells Cell Spacing and Padding Tables have two important attributes: 34 cell cell cell cell cell cell cell cell 6/6/2024

Cell Spacing and Padding – Example 35 <html> <head><title>Table Cells</title></head> <body> <table cellspacing="15" cellpadding="0"> <tr><td>First</td> <td>Second</td></tr> </table> <br/> <table cellspacing="0" cellpadding="10"> <tr><td>First</td><td>Second</td></tr> </table> </body> </html> table- cells .html 6/6/2024

6/6/2024 36 HTML Task

HTML Forms Entering User Data from a Web Page 6/6/2024 37

HTML Forms Forms are the primary method for gathering data from site visitors Create a form block with Example: <form></form> <form name="myForm" method="post" action="path/to/some-script.php"> ... </form> The "action" attribute tells where the form data should be sent The “method" attribute tells how the form data should be sent – via GET or POST request 6/6/2024 38

Form Fields Single-line text input fields: Multi-line textarea fields: Hidden fields contain data not shown to the user: <input type="text" name="FirstName" value="This is a text field" /> <textarea name="Comments">This is a multi-line text field</textarea> <input type="hidden" name="Account" value="This is a hidden text field" /> 6/6/2024 39

Fieldsets Fieldsets are used to enclose a group of related form fields: The <legend> is the fieldset's title. <form method="post" action="form.php"> <fieldset> <legend>Client Details</legend> <input type="text" id="Name" /> <input type="text" id="Phone" /> </fieldset> <fieldset> <legend>Order Details</legend> <input type="text" id="Quantity" /> <textarea cols="40" rows="10" id="Remarks"></textarea> </fieldset> </form> 6/6/2024 40

Form Input Controls Checkboxes: Radio buttons: Radio buttons can be grouped, allowing only one to be selected from a group: 41 <input type="checkbox" name="fruit" value="apple" /> <input type="radio" name="title" value="Mr." /> <input type="radio" name="city" value="Lom" /> <input type="radio" name="city" value="Ruse" /> 6/6/2024

Other Form Controls Dropdown menus: Submit button: 42 <select name="gender"> <option value="Value 1" selected="selected">Male</option> <option value="Value 2">Female</option> <option value="Value 3">Other</option> </select> <input type="submit" name="submitBtn" value="Apply Now" /> 6/6/2024

Other Form Controls (2) Reset button – brings the form to its initial state Image button – acts like submit but image is displayed and click coordinates are sent 43 <input type="reset" name="resetBtn" value="Reset the form" /> <input type="image" src="submit.gif" name="submitBtn" alt="Submit" /> 6/6/2024

Other Form Controls (3) Password input – a text field which masks the entered text with * signs Multiple select field – displays the list of items in multiple lines, instead of one 44 <input type="password" name="pass" /> <select name="products" multiple="multiple"> <option value="Value 1" selected="selected">keyboard</option> <option value="Value 2">mouse</option> <option value="Value 3">speakers</option> </select> 6/6/2024

Other Form Controls (4) File input – a field used for uploading files When used, it requires the form element to have a specific attribute: 45 <input type="file" name="photo" /> <form enctype="multipart/form-data"> ... <input type="file" name="photo" /> ... </form> 6/6/2024

Labels Form labels are used to associate an explanatory text to a form field. 46 <label for="fn">First Name</label> 6/6/2024

LAB Task - Design following HTML Form 47 LAB TASK : HTML Form 6/6/2024
Tags