day10 front-end basis

  Front-end language: html: page will show up css: modified html tags js: allows the page move up

  html interact with the background there are two ways to ways 1.form form, basically abandoned (form form will force a refresh to clear data after submission) 2. Asynchronous submit, after making the action, not the action page, but the background of the submit to verification success or failure will be the paradigm of data streams back to the front page or jump to refresh or controlled by the same front end. ajax

html code is actually capable of being recognized by a browser to the code rule, by the composition of a label, the html code string is a long list, and format of such strings can be precisely identified when the browser is also we have a web page.

  html major learning can be recognized by the browser labeling rules

  html the head

 

 --------------------------------------------------------------

  After writing the attributes of the html body inside the tag label name between <>. Attribute and tag names separated by spaces

        Between attributes and attribute separated by spaces

  1. h label, also known as the title tag h1 --- h6 descending.

<h1>h1</h1>
<h2>h2</h2>
<h3>h3</h3>
<h4>h4</h4>
<h5>h5</h5>
<h6>h6</h6>
 
2. div标签和 3.span标签,这两个也叫白板标签,没有任何的修饰。div也叫伪白版标签,把行内标签修饰为块级标签
div是块级标签,无论自己有多大,都占满屏幕 span是行内标签又叫内联标签,自己有多大就占多大
4.input标签 输入框。 所有的输入框都可以增加name属性。每个都有name属性。
type就是怎么去对输入框进行解析。name就是key的值。和后端进行交互,根据接口文档设计key的值。
value就是输入的是什么,默认值,不想默认就重新输入
placeholder:提示语
value属性:是input的默认值
<input type="text" placeholder="请输入用户名">
<input type="text" value="请输入用户名">

 

 input标签  如果type 为password .则输入到输入框的内容为密文。type为text输入到输入框内容是明文

type为button ,是一个按钮

type为submit,也是一个按钮,如果两个单独用没有区别,但是 和其它标签连用就有区别

  submit如果和form表单连用的话,会触发一个事件,会去提交数据,而button则点击是没有效果的

<input type="button" value="登录">登录按钮
<input type="password">

 

 button什么时候来用,需要去主动绑定事件。就是点了button去做那些操作。通过onclick事件去绑定方法。  <input type="button" value="登录" onclick="alert(111)">

 

input。radio实现单选,type用radio 和name一起用,浏览器会识别name值一样,就会只选择一个。

checked="checked".加这个参数,则表示默认选择

<span>男</span><input type="radio" name="sex" checked="checked">
<span>女</span><input type="radio" name="sex">

 

-----------------------

 input。checkbox实现多选,type用checkbox,和name连用没用

 

 -----------------------------------

input。file实现上传文件  type为file
<input type="file">
-----------------------
input type为reset.重置内容。必须和form表单连用,否则没有任何意义。
----------------------------------------------------------------------------------------





  

 

 

 

Guess you like

Origin www.cnblogs.com/11-pythong/p/11979821.html