current position:Home>Discussion on HTML page knowledge
Discussion on HTML page knowledge
2022-05-15 02:37:45【Koki can test a rookie】
One 、web Composition of the page : HTML + css + javascript
HTML Define the content of the page , The content of text implementation
css Pattern design , Templates Such as : The font color , font size , Typesetting
javascript programing language : Logical verification Dynamic
stay pycharm Build a new one inside html file .
<title>python-20211229</title>
— Represents the title line
<input></input>
— Represents the input field line <input type="text"></input>
— Represents the property of the input box line text box <input type=submit></input>
Submit properties <input type=password></input>
Password box properties <input type=file></input>
File upload properties <input type=radio></input>
Radio box properties <input type=checkbox></input>
Check box properties <input type=button></input>
Button properties <rb>
Line break
for example 1:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>python-20211229</title>
</head>
<body>
Favorite anime :
<input type=checkbox> One piece </input>
<input type=checkbox> Doulo land </input>
</body>
</html>
The page display :
for example 2:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>python-20211229</title>
</head>
<body>
Favorite anime :
<input type="checkbox"> One piece
<input type="checkbox"> Doulo land
<br>
Gender :
<input type="radio" name="sex"> male
<input type="radio" name="sex"> Woman
</body>
</html>
The page display :
Two 、HTML label - attribute
1.<input type="text" readonly>
readonly Read-only property , The input box is not editable
2.<input type="text" placeholder=" Please enter 8 Digit number ">
placeholder Prompt when helping users input
3.<input type="checkbox" checked >
One piece checked Selected by default
Favorite anime :
<input type="checkbox" checked > One piece
<input type="checkbox"> Doulo land
4.<input type="checkbox" disabled >
One piece input This element is disabled when the element is loaded
5.
The first stands for disabling , the second button Submit on behalf of the button , The third is to submit
<input type=button value=" Submit " disabled >
<input type=button value=" Submit " >
<button> Submit </button>
6. link a Is an element ,herf Attribute <!-- link -->
html notes <a href="http://map.baidu.com"> Map </a>
html Link address
7. html picture <img src="Untitled.png">
html picture src= Path to picture
8.html picture <img src="Untitled.png" width="270" height="129">
html Picture size settings width Width heigt Height
9. The drop-down list
select and option Coexist
Upload files :
<select name="ft" size="1"> == $0
<option value="pdf">Adobe Acrobat PDF (.pdf)</option>
<option value="doc"> Microsoft Word (.doc)</option>
<option value="xls"> Microsoft Excel (.xls)</option>
<option value="ppt"> Microsoft Powerpoint (.ppt)</option>
<option value="rtf">RTF file (.rtf)</option>
<option value="all"> All formats </option>
</select>
It is shown that :
10. Forms
<form><!-- Forms -->
<input type="text">
<table border="2"><!-- Frame -->
<tr><!-- That's ok -->
<td>11</td><!-- Column -->
<td>22</td>
<td>33</td>
</tr>
<tr>
<td>22</td>
<td>33</td>
<td>44</td>
</tr>
<tr>
<td>55</td>
<td>66</td>
<td>77</td>
</tr>
</table>
</form>
It is shown that :
11.iframe A web page is nested in a web page
<iframe src="//xui.ptlogin2.qq.com/cgi-bin/xlogin?"><!--iframe: Inner frame Inside is a html page -->
</iframe>
such as : The login page of the web page 12. Large text box
<textarea></textarea>
Enter unlimited
13. Title box <H1> Headline </H1>
H1-H6 All represent the size of the input box
14.id Is each html The only attribute of the page or style: Set the style .
More knowledge to :w3school understand , Poke me
Two 、DOM object Full name :Document Object Mode It's a set web standard , Access defined html A set of attributes of a document , Add, delete, modify, etc .
Other languages , Such as JAVA/PYTHON To operate html page , Do not operate directly , It's through DOM Object and then operate .HTML DOM Used exclusively for the operation of HTML page . therefore : Scripting language through DOM Object to access html page
At present , If you use it directly in the front page DOM Object words , Also need to use Java Script The grammatical .
Java Script Simple grammar
<script></script>
var That is variable Statement
var Variable name = value
list : var he = [a,b,c,d] alert(he[1])
Tip pop up a
Dictionaries :var hei = {"name":"value","sex":"unknown"}
Call it :hei.name
function :
function The name of the function ( Parameters , Parameters ){
return value ;
}
call : The name of the function ( Parameters )
debugging :
result :
Look for the element :
2.1
name | Corresponding |
---|---|
getElementById ID attribute : | kw |
getElementsByClassName class attribute : | s_ipt |
getElementsByName name attribute : | wd |
getElementsByTagName Tag name | input |
Elemental ID attribute :
document.getElementById("kw")
Elemental class attribute :
document.getElementsByClassName("s_ipt")
Elemental name attribute :
document.getElementsByName("wd")
The tag name of the element :
document.getElementsByTagName("input")
css Selectors :
document.querySelector(css)
Example : Select the search box of Adu's page , Enter the code in the console below , Proper :
document.getElemenByld("kw")
The result is located in the corresponding option box
2.2 Attribute of element :
Change properties :
document.getElemenByXXX(""). Property name = Property value
get attribute :
document.getElemenByXXX("").getAttribute( Property name )
chestnuts :
Setup modification
1.
So the result :
2.
So the result :
3.
Change the text / Change font color :
First locate :
a = document.getElementById("articleContentId")
a.innerText=" Read txt Read the column of a character in the file "
a.style.color = "red"
3、 ... and 、 event
Browser and user events , Trigger - perform js The response of different pages brought by the code .
for example : Click event 、 Input event 、 Mouse events, etc .
Page loading completion event :
window.onload = function(){
alert(“everything is ready!!”)
}
Click event :
document.findElementByld(XXX).οnclick= function(){
alert(“ Click on OK”)
}
Loading event :
3.1, The mouse trigger turns red , Remove the green js Code : Be careful Input wrap shift+enter Key wrap
<!-- Navigate to element -->
a = document.getElementById("title")
<!-- Red -->
a.onmouseover = function(){
a.style.color = 'red';
}
<!-- green -->
a.onmouseout = function(){
a.style.color = 'green';
}
Effect of page
Trigger : Move away :
copyright notice
author[Koki can test a rookie],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/132/202205120517585173.html
The sidebar is recommended
- React error report record
- Analysis of react life cycle function
- react demo1 TodoList
- Summary of the differences between state and props in react
- Difference between controlled components and uncontrolled components in react
- Node. JS use get Stream download file
- How does JavaScript copy arrays instead of references
- JavaScript calculates the number of days, hours, minutes and seconds between days
- JQuery get page address parameters
- JavaScript create Download
guess what you like
node. JS traversal directory
Tips for using JavaScript string split (how to keep the delimiter)
Common CSS notes
JavaScript usage Get the address of the regular function
New generation node JS web development framework koa zero foundation entry learning notes
JavaScript notes
asp. Net core method for modifying HTML without rerun
Summary of compatibility processing of H5 + Vue cli project in Safari browser
Summary of amap scheme of Gaode map used in vue3 + TS project
Summary of filter scheme used in JS code in Vue
Random recommended
- Build an electron project based on Vue from scratch
- In Vue project, solve the problem of verification conflict when eslint and prettier are used at the same time
- Vue3 + vuecli4 solve chunk vendors JS file is too large. Scheme summary
- Scheme summary of eslint check before vue3 + vite configuration project operation and eslint check before git submission
- Fatal authentication failed for 'httpxxxx Git 'solution
- Vue's solution to the compatibility of hevc encoded video in each end browser
- Record the solution to the error in obtaining the picture in springboot in Vue
- [Vue] detailed analysis of the life cycle function of Vue components
- [Vue] deeper understanding of user-defined attribute props
- [Vue] front end error: cannot read properties of undefined (reading 'split')
- [Vue] asynchronous problem of component value transfer -- the sub component gets the data slowly
- [Vue] Vue data changes, but the page is not updated in real time
- [element UI] use of form verification -- detailed explanation
- [Vue] use of slots - Review
- The influence on the fixed positioning element of the inner layer when the outer element has a fixed height and overflows and rolls
- Precautions
- Change detection strategy of angular component
- Angular service and @ injectable
- JS, HTML and CSS are not compatible and do not use common knowledge
- Properties to be known in angular @ component
- Angular acquisition and operation DOM
- Html2canvas problem
- Use day in Vue JS (time and date processing library)
- Vue cli configuring preprocessor global variables (take less as an example)
- How to use H5 custom tags in Vue?
- Come on, vue2 customize global loading
- Come on, Vue move the end suspension ball assembly
- React routing foundation and transmission parameters
- Come on, Vue graphic verification code component
- JavaScript judges browser types and kernels at home and abroad (including 360, QQ, Sogou, etc.)
- ArcGIS JavaScript 4. Generates a rectangular buffer at the point of X
- Node under window JS installation, environment configuration, setting Taobao image
- Understanding of prototype and prototype object of JavaScript
- How to customize the startup port of react project!
- Why vue3 0 using proxy to realize data listening 2021-06-21
- Front end artifact - download, configuration and use process of Charles (vase) [Mac version]
- React next configures SVG loader and supports SVG configurability
- React native Android phone cannot be opened after installation. Flash back!
- Fetch and Axios failed to request on Android, with error messages: network request failed and network error
- How to upgrade react Babel 7.1.0