Presentation is loading. Please wait.

Presentation is loading. Please wait.

Meta Tags You can add metadata to your web pages by placing tags inside the header of the document which is represented by and tags. A meta tag can have.

Similar presentations


Presentation on theme: "Meta Tags You can add metadata to your web pages by placing tags inside the header of the document which is represented by and tags. A meta tag can have."— Presentation transcript:

1 Meta Tags You can add metadata to your web pages by placing tags inside the header of the document which is represented by and tags. A meta tag can have following attributes in addition to core attributes: CENG 449 Lecture 11 AttributeDescription NameName for the property. Can be anything. Examples include, keywords, description, author, revised, generator etc. contentSpecifies the property's value. schemeSpecifies a scheme to interpret the property's value (as declared in the content attribute). http-equivUsed for http response message headers. For example http- equiv can be used to refresh the page or to set a cookie. Values include content-type, expires, refresh and set-cookie.

2 Specifying Keywords You can use tag to specify important keywords related to the document and later these keywords are used by the search engines while indexing your webpage for searching purpose. Meta Tags Example Hello HTML5! CENG 449 Lecture 12

3 Document Description You can use tag to give a short description about the document. This again can be used by various search engines while indexing your webpage for searching purpose. Meta Tags Example Hello HTML5! CENG 449 Lecture 13

4 Document Revision Date You can use tag to give information about when last time the document was updated. This information can be used by various web browsers while refreshing your webpage. Meta Tags Example Hello HTML5! CENG 449 Lecture 14

5 Document Refreshing A tag can be used to specify a duration after which your web page will keep refreshing automatically. If you want your page keep refreshing after every 5 seconds then use the following syntax. Meta Tags Example Hello HTML5! CENG 449 Lecture 15

6 Page Redirection You can use tag to redirect your page to any other webpage. You can also specify a duration if you want to redirect the page after a certain number of seconds. Following is an example of redirecting current page to another page after 5 seconds. If you want to redirect page immediately then do not specify content attribute. Meta Tags Example Hello HTML5! CENG 449 Lecture 16

7 Setting Author Name You can set an author name in a web page using meta tag. See an example: Meta Tags Example Hello HTML5! CENG 449 Lecture 17

8 Specify Character Set You can use tag to specify character set used within the webpage. Example By default, Web servers and Web browsers use ISO-8859-1 (Latin1) encoding to process Web pages. Following is an example to set UTF-8 encoding: Meta Tags Example Hello HTML5! CENG 449 Lecture 18

9 HTML FORMS HTML Forms are required when you want to collect some data from the site visitor. For example during user registration you would like to collect information such as name, email address, credit card, etc. A form will take input from the site visitor and then will post it to a back- end application such as CGI, ASP Script or PHP script etc. The back-end application will perform required processing on the passed data based on defined business logic inside the application. There are various form elements available like text fields, textarea fields, drop-down menus, radio buttons, checkboxes, etc. The HTML tag is used to create an HTML form and it has following syntax: form elements like input, textarea etc. CENG 449 Lecture 19

10 Form Attributes AttributeDescription actionBackend script ready to process your passed data. methodMethod to be used to upload data. The most frequently used are GET and POST methods. targetSpecify the target window or frame where the result of the script will be displayed. It takes values like _blank, _self, _parent etc. enctypeYou can use the enctype attribute to specify how the browser encodes the data before it sends it to the server. Possible values are: application/x-www-form-urlencoded - This is the standard method most forms use in simple scenarios. mutlipart/form-data - This is used when you want to upload binary data in the form of files like image, word file etc. CENG 449 Lecture 110

11 HTML Form Controls There are different types of form controls that you can use to collect data using HTML form: Text Input Controls Checkboxes Controls Radio Box Controls Select Box Controls File Select boxes Hidden Controls Clickable Buttons Submit and Reset Button CENG 449 Lecture 111

12 Text Input Controls There are three types of text input used on forms: Single-line text input controls - This control is used for items that require only one line of user input, such as search boxes or names. They are created using HTML tag. Password input controls - This is also a single-line text input but it masks the character as soon as a user enters it. They are also created using HTMl tag. Multi-line text input controls - This is used when the user is required to give details that may be longer than a single sentence. Multi-line input controls are created using HTML tag. CENG 449 Lecture 112

13 Single-line text input controls This control is used for items that require only one line of user input, such as search boxes or names. They are created using HTML tag. Syntax: CENG 449 Lecture 113

14 Attributes Following is the list of attributes for tag for creating text field. AttributeDescription typeIndicates the type of input control and for text input control it will be set to text. nameUsed to give a name to the control which is sent to the server to be recognized and get the value. valueThis can be used to provide an initial value inside the control. size Allows to specify the width of the text-input control in terms of characters. maxlength Allows to specify the maximum number of characters a user can enter into the text box. CENG 449 Lecture 114

15 Text Input Control First name: Last name: CENG 449 Lecture 115

16 Password input controls Password Input Control User ID : Password: CENG 449 Lecture 116

17 Multiple-Line Text Input Controls This is used when the user is required to give details that may be longer than a single sentence. Multi-line input controls are created using HTML tag. Multiple-Line Input Control Description : Enter description here... CENG 449 Lecture 117

18 Attributes Following is the list of attributes for tag AttributeDescription nameUsed to give a name to the control which is sent to the server to be recognized and get the value. rowsIndicates the number of rows of text area box. cols Indicates the number of columns of text area box CENG 449 Lecture 118

19 Checkbox Control Checkboxes are used when more than one option is required to be selected. They are also created using HTML tag but type attribute is set to checkbox. Checkbox Control Maths Physics CENG 449 Lecture 119

20 Attributes Following is the list of attributes for tag. AttributeDescription typeIndicates the type of input control and for checkbox input control it will be set to checkbox. nameUsed to give a name to the control which is sent to the server to be recognized and get the value. valueThe value that will be used if the checkbox is selected. checkedSet to checked if you want to select it by default. CENG 449 Lecture 120

21 Checkbox Please select your favorite music service(s): iTunes Last.fm Spotify CENG 449 Lecture 121

22 Radio Button Control Radio buttons are used when out of many options, just one option is required to be selected. They are also created using HTML tag but type attribute is set to radio. Radio Box Control Maths Physics CENG 449 Lecture 122

23 Attributes Following is the list of attributes for radio button. AttributeDescription typeIndicates the type of input control and for checkbox input control it will be set to radio. nameUsed to give a name to the control which is sent to the server to be recognized and get the value. valueThe value that will be used if the radio box is selected. checkedSet to checked if you want to select it by default. CENG 449 Lecture 123

24 Radio Button Please select your favorite genre: Rock Pop Jazz CENG 449 Lecture 124

25 Select Box Control A select box, also called drop down box which provides option to list down various options in the form of drop down list, from where a user can select one or more options. Select Box Control Maths Physics CENG 449 Lecture 125

26 When mouse is clicked on down arrow, the other options are also displayed CENG 449 Lecture 126

27 Attributes Following is the list of important attributes of tag: Attribute Description name Used to give a name to the control which is sent to the server to be recognized and get the value. size This can be used to present a scrolling list box. multipleIf set to "multiple" then allows a user to select multiple items from the menu. CENG 449 Lecture 127

28 Following is the list of important attributes of tag: AttributeDescription valueThe value that will be used if an option in the select box is selected. selectedSpecifies that this option should be the initially selected value when the page loads. labelAn alternative way of labeling options CENG 449 Lecture 128

29 File Upload Box If you want to allow a user to upload a file to your web site, you will need to use a file upload box, also known as a file select box. This is also created using the element but type attribute is set to file. File Upload Box CENG 449 Lecture 129

30 Attributes Following is the list of important attributes of file upload box: AttributeDescription nameUsed to give a name to the control which is sent to the server to be recognized and get the value. accept Specifies the types of files that the server accepts. CENG 449 Lecture 130

31 Button Controls There are various ways in HTML to create clickable buttons. You can also create a clickable button using tag by setting its type attribute to button. The type attribute can take the following values: TypeDescription submit:This creates a button that automatically submits a form. reset:This creates a button that automatically resets form controls to their initial values. button:This creates a button that is used to trigger a client-side script when the user clicks that button. image:This creates a clickable button but we can use an image as background of the button. CENG 449 Lecture 131

32 File Upload Box CENG 449 Lecture 132

33 Hidden Form Controls Hidden form controls are used to hide data inside the page which later on can be pushed to the server. This control hides inside the code and does not appear on the actual page. For example, following hidden form is being used to keep current page number. When a user will click next page then the value of hidden control will be sent to the web server and there it will decide which page has be displayed next based on the passed current page. File Upload Box This is page 10 CENG 449 Lecture 133

34 Multiple Select Box Do you play any of the following instruments? (You can select more than one option by holding down control on a PC or command key on a Mac while selecting different options.) Guitar Drums Keyboard Bass CENG 449 Lecture 134

35 CENG 449 Lecture 135

36 Using CTRL button you can select multiple options CENG 449 Lecture 136

37 File Input Box Upload your song in MP3 format: CENG 449 Lecture 137

38 Grouping Form Elements You can group related form controls together inside the element. This is particularly helpful for longer forms. The element can come directly after the opening tag and contains a caption which helps identify the urpose of that group of form controls. CENG 449 Lecture 138

39 Grouping Form Elements Contact details Email: Mobile: Telephone: CENG 449 Lecture 139

40 CENG 449 Lecture 140

41 Form Validation You have probably seen forms on the web that give users messages if the form control has not been filled in correctly; this is known as form validation. HTML5 Form Validation Username: Password: CENG 449 Lecture 141

42 HTML5 Form Validation Username: Password: CENG 449 Lecture 142

43 Date Input HTML5 introduces new form controls to standardize the way that some information is gathered. Older browsers that do not recognize these inputs will just treat them as a single line text box. HTML5 Date Input Departure date: CENG 449 Lecture 143

44 CENG 449 Lecture 144

45 HTML 5: Emai l & URL Input HTML5 has also introduced inputs that allow visitors to enter email addresses and URLs. Browsers that do not support these input types will just treat them as text boxes. HTML5 Email Input Please enter your email address: CENG 449 Lecture 145

46 HTML5 URL Input Please enter your website address: CENG 449 Lecture 146

47 Image Button Subscribe to our email list: CENG 449 Lecture 147

48 HTML5: SEARCH INPUT To create the HTML5 search box the element should have a type attribute whose value is search. Older browsers will simply treat it like a single line text box. HTML5 Search Input Search: CENG 449 Lecture 148

49 HTML5 Placeholder Search: CENG 449 Lecture 149

50 Forms Your Details: Name: Email: Your Review: How did you hear about us? Google Friend Advert Other Would you visit again? Yes No Maybe Comments: Sign me up for email updates CENG 449 Lecture 150

51 CENG 449 Lecture 151

52 DOCTYPEs Because there have been several versions of HTML, each web page should begin with a DOCTYPE declaration to tell a browser which version of HTML the page is using (although browsers usually display the page even if it is not included). CENG 449 Lecture 152

53 CENG 449 Lecture 153

54 Comments in HTML If you want to add a comment to your code that will not be visible in the user's browser, you can add the text between these characters: CENG 449 Lecture 154

55 Iframes An iframe is like a little window that has been cut into your page — and in that window you can see another page. The term iframe is an abbreviation of inline frame. One common use of iframes (that you may have seen on various websites) is to embed a Google Map into a page. The content of the iframe can be any html page (either located on the same server or anywhere else on the web). CENG 449 Lecture 155

56 CENG 449 Lecture 156

57 iFrames Daha Büyük Görüntüle CENG 449 Lecture 157

58 CENG 449 Lecture 158

59 iFrames Daha Büyük Görüntüle CENG 449 Lecture 159

60 CENG 449 Lecture 160

61 iFrames CENG 449 Lecture 161

62 There are some characters that are used in and reserved by HTML code CENG 449 Lecture 162


Download ppt "Meta Tags You can add metadata to your web pages by placing tags inside the header of the document which is represented by and tags. A meta tag can have."

Similar presentations


Ads by Google