0104-2020- simple front-end summary (HTML & CSS & JavaScript & Bootstrap)

Article Content Source: Bootstrap section 57 JavaWeb dark horse in
HTML: Hyper Text Markup Language
HTML:
Hypertext: Hypertext is hyperlinked to the method, a variety of text at different spatial information organization mesh with the text .
Markup languages: not a programming language (as long as you write will be executed).
extension html documents: .html, or .xml.
Constituted by the label language.
Containment tags:
Tags can not you have me I have you.
And as MySQL are case insensitive, but the official suggested lowercase.
File tags: html root tag / head plus head tag attributes / title heading tags / body body label
text label:
HTML syntax is not strict.
More tags category.
CSS: Cascading Style Sheets

JavaScript
a scripting language, can achieve some dynamic effects, and better user interaction.

JavaScript is actually a loosely typed language. var type variable value of any type may be defined.
A typeof () operator
attention, there is a characteristic JS:
± No. latter value can be automatically converted into number
because the value JS different types may be compared so that there is a special JS comparison operators: congruent (if different type directly return false).
! 0 and non-NaN is true, the other false; the remaining empty string is false is true.
Statement ends with a semicolon, but there is a line break line can be.
var global variable is not
a local variable is the
parameter type may be omitted when the method definition, i.e. without var
same JS method overrides without error.
JS objects in:
Function
Array is a special place various types of numbers.
Regular Expressions:

DOM: control the content of the document




电灯开关

	</head>
	<body>
	
	<img id="light" src="img/off.gif">
	
	<script>
	    /*
	        分析:
	            1.获取图片对象
	            2.绑定单击事件
	            3.每次点击切换图片
	                * 规则:
	                    * 如果灯是开的 on,切换图片为 off
	                    * 如果灯是关的 off,切换图片为 on
	                * 使用标记flag来完成
	
	     */
	
	    //1.获取图片对象
	    var light = document.getElementById("light");
	
	    var flag = false;//代表灯是灭的。 off图片
	
	    //2.绑定单击事件
	    light.onclick = function(){
	        if(flag){//判断如果灯是开的,则灭掉
	            light.src = "img/off.gif";
	            flag = false;
	
	        }else{
	            //如果灯是灭的,则打开
	
	            light.src = "img/on.gif";
	            flag = true;
	        }


	
	    }
	    
	</script>
	</body>
	</html>

Window: window object
alert () displays a warning message box with a period and a confirmation button.
confirm () displays a dialog box with a message and the confirmation period and a cancel button buttons.
* If the user clicks the OK button, the method returns to true
* If the user clicks the Cancel button, the method returns false
prompt () display can prompt the user to enter the dialog box.
* Return value: Gets the value entered by the user

Bowser object model

JUDGMENT:

  • W3C DOM standard is divided into three distinct parts:

  • Core DOM - standard model for any structured document

  • XML DOM - standard model for XML documents

  • HTML DOM - standard model for HTML documents

  • Core DOM model:

  • Element: element object
    1. Get / create: to capture and create through the Document
    2. Method:
    1. removeAttribute (): Delete Attribute
    2. setAttribute (): set the properties

  • Node: node object, the other five of the parent
    * Features: All dom object can be thought of as a node
    * Methods:
    * CRUD dom tree:
    * appendChild (): Adds a new child node to the end node of the list of child nodes .
    * RemoveChild (): Delete (and return to) the specified child node of the current node.
    * ReplaceChild (): Replace with a child node of the new node.
    * Attributes:
    * Returns the parent node of parentNode.
    Event:
    Focus
    mouse
    keyboard
    submission form
    Bootstrap: a front-end development framework, is a semi-finished software.
    benefit:

  1. It defines a number of styles.
  2. Responsive layout. The same set of pages can be compatible with different resolution devices.

Bootstrap:

1. 概念: 一个前端开发的框架,Bootstrap,来自 Twitter,是目前很受欢迎的前端框架。Bootstrap 是基于 HTML、CSS、JavaScript 的,它简洁灵活,使得 Web 开发更加快捷。
	* 框架:一个半成品软件,开发人员可以在框架基础上,在进行开发,简化编码。
	* 好处:
		1. 定义了很多的css样式和js插件。我们开发人员直接可以使用这些样式和插件得到丰富的页面效果。
		2. 响应式布局。
			* 同一套页面可以兼容不同分辨率的设备。


2. 快速入门
	1. 下载Bootstrap
	2. 在项目中将这三个文件夹复制
	3. 创建html页面,引入必要的资源文件


	<!DOCTYPE html>
	<html lang="zh-CN">
	<head>
	    <meta charset="utf-8">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	    <meta name="viewport" content="width=device-width, initial-scale=1">
	    <!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
	    <title>Bootstrap HelloWorld</title>
	
	    <!-- Bootstrap -->
	    <link href="css/bootstrap.min.css" rel="stylesheet">






Hello world!

	</body>
	</html>

Responsive layout

* 同一套页面可以兼容不同分辨率的设备。
* 实现:依赖于栅格系统:将一行平均分成12个格子,可以指定元素占几个格子
* 步骤:
	1. 定义容器。相当于之前的table、
		* 容器分类:
			1. container:两边留白
			2. container-fluid:每一种设备都是100%宽度
	2. 定义行。相当于之前的tr   样式:row
	3. 定义元素。指定该元素在不同的设备上,所占的格子数目。样式:col-设备代号-格子数目
		* 设备代号:
			1. xs:超小屏幕 手机 (<768px):col-xs-12
			2. sm:小屏幕 平板 (≥768px)
			3. md:中等屏幕 桌面显示器 (≥992px)
			4. lg:大屏幕 大桌面显示器 (≥1200px)

	* 注意:
		1. 一行中如果格子数目超过12,则超出部分自动换行。
		2. 栅格类属性可以向上兼容。栅格类适用于与屏幕宽度大于或等于分界点大小的设备。
		3. 如果真实设备宽度小于了设置栅格类属性的设备代码的最小值,会一个元素沾满一整行。

CSS style and JS plugins

1. 全局CSS样式:
	* 按钮:class="btn btn-default"
	* 图片:
		*  class="img-responsive":图片在任意尺寸都占100%
		*  图片形状
			*  <img src="..." alt="..." class="img-rounded">:方形
			*  <img src="..." alt="..." class="img-circle"> : 圆形
			*  <img src="..." alt="..." class="img-thumbnail"> :相框
	* 表格
		* table
		* table-bordered
		* table-hover
	* 表单
		* 给表单项添加:class="form-control" 
2. 组件:
	* 导航条
	* 分页条
3. 插件:
	* 轮播图
Published 98 original articles · won praise 0 · Views 2210

Guess you like

Origin blog.csdn.net/weixin_43221993/article/details/103830521