HTML Basics Must-Read---Detailed Explanation of Forms, Image Hotspots, Web Page Division and Splicing

HTML Basics Must-Read---Detailed Explanation of Forms, Image Hotspots, Web Page Division and Splicing

1. Form

<form id="" name="" method="post/get" action="Server responsible for processing"> The id cannot be repeated; the name can be repeated; there is a length limit for get submission, and the encoded content is visible in the address bar; there is no length limit for post submission, and the encoded content is not visible.

</form>

1. Text Input

Text box <input type="txt" name="" id="" value="" />

Note: The value set above means setting the default value

Password box<input type="password" name="" id="" value="" />

Text area <textarea name="" id="" cols="" (number of characters) rows="" (number of rows high) ></textarea>

Hidden field <input type="hidden" name="" id="" value="" />

2. Buttons

Submit button <input type="submit" name="" id="" disabled="disabled" value=""/> Click to go to the submission server address in the form

Note: The value set above represents the text displayed above during runtime.

Reset button <input type="reset" name="" id="" disabled="disabled" value=""/>

Normal button <input type="button" name="" id="" disabled="disabled" value=""/>

Image button <input type="image" name="" id="" disabled="disabled" src="Image address"/>

Attachment:

disabled, makes the button invalid; enable, makes it available.

3. Select input

Radio button group <input type="redio" name="" checked="checked" value=""/> The name value is used for grouping; the value is invisible and is submitted to the program; checked sets the default option.

Note: Once a radio button group is selected, it cannot be unchecked.

Checkbox group <input type="checkbox" name="" checked="checked" value=""/>

Note: checked="checked" means it is selected right away, and the checkbox can be checked or unchecked.

File upload<input type="file" name="" id="" />

<label for=""></label>

The <label> tag defines a label (tag) for an input element.

The label element does not present any special effect to the user. However, it improves usability for mouse users. This control is triggered if you click on the text within the label element. That is, when the user selects the tag, the browser automatically shifts the focus to the form control associated with the tag.

The for attribute of the <label> tag should be the same as the id attribute of the associated element.

Drop-down list box

<select name="" id="" size="" multiple="multiple"> --When size=1, it is a menu; when >1, it is a list. multiple means multiple selection.

<option value="value">Content 1</option>

<option value="value" selected="selected">Content 2</option> --selected, set as default

<option value="value">Content 3</option>

</select>

In summary, the HTML program shows:

XML/HTML CodeCopy content to clipboard
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >   
  2. < html   xmlns = "http://www.w3.org/1999/xhtml" >   
  3. < head >   
  4. < meta   http-equiv = "Content-Type"   content = "text/html; charset=utf-8"   />   
  5. < title > Untitled Document </ title >   
  6. </ head >   
  7.   
  8. < body   background = "22.jpg" >   
  9. < form >   
  10. Account number: < input   type = "text"   value = "12345"   disabled = "disabled"   /> < br   /> < br   />   
  11. Password: < input   type = "password"   /> < br   /> < br   />   
  12. Say: < textarea   cols = "140"   rows = "8" > </ textarea > < br   /> < br   />   
  13. Question: In which year was the People's Republic of China founded? < input   type = "text"   />   
  14. < input   type = "submit"   value = "Submit"   />   
  15. < input   type = "hidden"   value = "1949"   />   
  16. < input   type = "reset"   /> < br   />   
  17. < input   type = "button"   value = "Login"   /> < br   />   
  18. < input   type = "image"   src = "55.jpg"   /> < br   />   
  19. < input   type = "radio"   name = "sex"   /> Male < br   />   
  20. < input   type = "radio"   name = "sex"   /> Female < br   />   
  21. < input   type = "checkbox"   checked = "checked"   /> Coke < br   />   
  22. < input   type = "checkbox"   /> Chicken drumstick < br   />   
  23. < input   type = "file"   /> < br   /> < br   />   
  24. < select   size = "1" >   
  25. < option   value = "11" > Coca-Cola </ option >   
  26. < option   value = "22" > Sprite </ option >   
  27. < option   value = "33"   selected = "selected" > Fanta </ option >   
  28. </ select >   
  29. </ form >   
  30. </ body >   
  31. </ html >   

The running results show:

Example analysis: Make a mailbox interface program display

XML/HTML CodeCopy content to clipboard
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >   
  2. < html   xmlns = "http://www.w3.org/1999/xhtml" >   
  3. < head >   
  4. < meta   http-equiv = "Content-Type"   content = "text/html; charset=utf-8"   />   
  5. < title > Untitled Document </ title >   
  6. </ head >   
  7.   
  8. < body   background = "11.jpg" >   
  9. < font   face = "Chinese Lishu" >   
  10. < table   align = "center"   width = "600"   height = "600"   border = "1"   cellpadding = "0"   cellspacing = "0" >   
  11. < tr >   
  12. < td   width = "150" > Email: </ td >   
  13. < td > < form > < input   type = "text"   /> </ form > </ td >   
  14. </ tr >   
  15. < tr >   
  16. < td > </ td >   
  17. < td   valign = "middle" > < font   color = "#999999" > You need to activate your account via email. Sohu, 21cn, and Sogou emails are not supported. </ font > </ td >   
  18.   
  19. </ tr >   
  20. < tr >   
  21. < td > Login Username: </ td >   
  22. < td > < form > < input   type = "text"   /> </ form > </ td >   
  23. </ tr >   
  24. < tr >   
  25. < td > </ td >   
  26. < td   valign = "middle" > < font   color = "#999999" > Only used when logging in, the number of characters must be at least 4 </ font > </ td >   
  27. </ tr >   
  28. < tr >   
  29. < td > Display Name: </ td >   
  30. < td > < form > < input   type = "text"   /> </ form > </ td >   
  31. </ tr >   
  32. < tr >   
  33. < td > </ td >   
  34. < td > < font   color = "#999999" > Nickname, no less than 2 characters </ font > </ td >   
  35. </ tr >   
  36. < tr >   
  37. < td > Password: </ td >   
  38. < td > < form > < input   type = "password"   /> </ form > </ td >   
  39. </ tr >   
  40. < tr >   
  41. < td > Confirm password: </ td >   
  42. < td > < form > < input   type = "password"   /> </ form > </ td >   
  43. </ tr >   
  44. < tr >   
  45. < td > </ td >   
  46. < td > < font   color = "#999999" > At least 8 characters, must contain letters, numbers, and special characters </ font > </ td >   
  47. </ tr >   
  48. < tr >   
  49. < td > Gender: </ td >   
  50. < td > < form > < select   size = "1" >   
  51. < option   value = "1"   selected = "selected" > Male </ option >   
  52. < option   value = "2" > Female </ option >   
  53. </ select > </ form >   
  54. </ td >   
  55. </ tr >   
  56. < tr >   
  57. < td > Preferences: </ td >   
  58. < td > < form > < select   size = "1" >   
  59. < option   value = "1" > Play games </ option >   
  60. < option   value = "2" > Play basketball </ option >   
  61. < option   value = "3" > Watch a movie </ option >   
  62. < option   value = "4"   selected = "selected" > Listen to music </ option >   
  63. < option   value = "5" > Travel </ option >   
  64. </ select > </ form >   
  65. </ td >   
  66. </ tr >   
  67. < tr >   
  68. < td > </ td >   
  69. < td > < form > < input   type = "submit"   value = "Register"   /> </ form > </ td >   
  70. </ tr >   
  71.   
  72. </ table >     
  73. </ font >   
  74. </ body >   
  75. </ html >   
The running results show:

2. Image Hotspots

Plan an area on the picture, create a hyperlink, and directly click on the picture area to achieve the jump effect.

Example:

XML/HTML CodeCopy content to clipboard
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >   
  2. < html   xmlns = "http://www.w3.org/1999/xhtml" >   
  3. < head >   
  4. < meta   http-equiv = "Content-Type"   content = "text/html; charset=utf-8"   />   
  5. < title > Untitled Document </ title >   
  6. </ head >   
  7.   
  8. < body >   
  9. < img   src = "a006.jpg"   usemap = "ditu"   />   
  10. < map   name = "ditu" >   
  11. < area   shape = "rect"   coords = "0,0,50,50"   href = "http://www.baidu.com"   />   
  12. < area   shape = "circle"   coords = "265,118,80"   href = "http://qq.com"   />   
  13. </ map >   
  14. </ body >   
  15. </ html >   

Design interface: When the mouse is placed on the rectangular and circular areas during operation, they will turn into a small hand shape, indicating that there is a link.

3. Web page division and splicing

Division of area: In a web page, an area is planned to display the content of another web page.

Example:

Stitching: Within a web page, multiple page windows are planned and displayed in the form of table stitching. (You can imagine the monitoring screen, multiple screens are displayed at the same time)

Example:

The above article on HTML basics must-read - forms, image hotspots, web page zoning and splicing detailed explanations is all the content that the editor shares with you. I hope it can give you a reference, and I also hope that you will support 123WORDPRESS.COM.

Original URL: http://www.cnblogs.com/H2921306656/archive/2016/07/09/5656699.html

<<:  vsftpd virtual user based on MySql authentication

>>:  Introduction to SSL certificate installation and deployment steps under Nginx

Recommend

How to install MySQL 5.7.29 with one click using shell script

This article refers to the work of 51CTO blog aut...

How to View All Running Processes in Linux

You can use the ps command. It can display releva...

Use of MySQL triggers

Triggers can cause other SQL code to run before o...

Detailed explanation of mysql backup and recovery

Preface: The previous articles introduced the usa...

Analysis of MySQL concurrency issues and solutions

Table of contents 1. Background 2. Slow query cau...

Example code for implementing triangles and arrows through CSS borders

1. CSS Box Model The box includes: margin, border...

my.cnf parameter configuration to optimize InnoDB engine performance

I have read countless my.cnf configurations on th...

18 Amazing Connections Between Interaction Design and Psychology

Designers need to understand psychology reading n...

Vue implements horizontal scrolling of marquee style text

This article shares the specific code for Vue to ...

Start a local Kubernetes environment using kind and Docker

introduce Have you ever spent a whole day trying ...

Highly recommended! Setup syntax sugar in Vue 3.2

Table of contents Previous 1. What is setup synta...

How to deploy Tencent Cloud Server from scratch

Since this is my first post, if there are any mis...

Solve the installation problem of mysql8.0.19 winx64 version

MySQL is an open source, small relational databas...