HTML,hyper text markup language,The function is to divide the structure of the web page.How many pages are there in total,What small pieces are in this piece?,What elements are contained in the small pieces?...And give a name to the key structure(class=xxx, id=xxx),Easy to adjust the appearance style of the key structure,Add logic to key structures.
CSS,casecade sheet style,The function is to adjust the appearance of the web page structure,布局.通過標簽名、class名、id名和HTMLThe structure in corresponds to.
JavaScript,The function is to capture the user's behavior on the web page,實現自定義的邏輯,eventually make a change on the page.通過DOM中的getElementById、getElementByClassName等與HTMLThe structure in corresponds to,通過setAttributeTo add new structureclass,這個class在CSSalready defined in.一旦attribute增加,CSSThe style is used,Web page style changes accordingly.
css中的定位:浮動定位,(Gel layout),絕對定位,表格布局.Two-column or even multi-column layout examples are often used to discuss specific effects.
浮動定位:Be sure to specify the width of the structure,Then float to the far left or far right of the layoutable space.Over the following structure to fill,形成環繞效果.Above the footbar you can useclearTo avoid the shading effect caused by the floating bar.
(Gel layout:To keep important contentHTMLpriority in(On the small screen of the mobile phone, it will follow theHTML順序顯示,First show so long sidebar),When important content is on the left side of the double column,Select left-float important content,instead of a simple right floating sidebar.The left float operation make the sidebar could expand greatly,Then add a large of specified widthdiv,About to hold the column width,make this bigdiv左右margin都保持auto就行了.At this time, you don't even need to float to the left.It's OK to be underutilizing window space).
絕對定位:bordered by window,Specifies the distance of the structure from the current boundary,Regardless of window zoom,keep this distance.Then you can specify the absolute position of the right column(At the same time, ensure that the left column of important content is in theHTMLpriority on).The left important content column only needs to specify the distance to the border(Left to the right column).But there's no way to overcome the cover of the column on the right side of the scale bar to the feet.
表格布局:The left column that ensures important content is in theHTMLpriority on,Can fully use the window space,Can overcome the shadowing effect of the right column scaling on the foot column.
code behind withjs功能上有什麼區別?
pythonbackground processing viarequestGet the form value submitted by the user,Then implement a series of logic,把結果通過render_templatereturn web page.那麼javescriptwhen does it work??Does not involve the form data background logic part(Form data local logic,點擊行為),可以直接用js直接處理掉(頁面樣式,Impression value, etc.),js用getElementByIdWait to get the form value,Involves the form data background logic part,you need to use the backend.
Some error-prone details encountered in programming:
1,JavaScript中,Be sure to add before defining variablesvar,不像pythonCan be used without definition.
2,聲明類、semicolon after variable;
3,Add a comma after declaring members in a class,
4,Do not add punctuation after defining a function
5,htmlAttributes in the tags are separated by spaces,Do not use commas to separate,比如
<link rel="stylesheet" href="battleship.css">