When I learned Bootstrap by myself, I followed the official website documentation. The official website is actually very clear and complete, but for front-end beginners, there are still many scattered knowledge points that can be ignored for the time being.
[Related video recommendation: Bootstrap tutorial]
So here is a short summary of the knowledge points. , I hope it can help you in the "getting started" aspect.
bootstrap Notes-Starting CSS Basics
1. Getting Started
1. Quote
Download through the official website, or provide it through bootCDN CDN service, or quote the document through the CDN service provided by cdnjs
bootstrap.min.css bootstrap.min.js
You need to quote jquery
jquery.min.js
CDN service
https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js
before referencing bootstrap.min.js When we document, it is recommended to write it at the bottom of the body tag content
… <bdoy> … <script src="jquery.min.js"></script> <script src="bootstrap.min.js"></script> </body> …
2. Mobile first
In order to ensure proper drawing and touch screen scaling, you need to add it in
viewport metadata tag.<meta name="viewport" content="width=device-width, initial-scale=1">
On mobile device browsers, the zooming function can be disabled by setting the meta attribute of the viewport to user-scalable=no.
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
If you want to understand the specific content of the above code, you want to fully understand the problem of moving pixels. It is recommended to go to MOOC.com to take a look at the WEB mobile course
2. CSS layout
1. Layout container
Content container, the width has been adjusted Fixed (with spacing on the left and right)
<div class="container"></div>
Content container, width is 100%
<div class="container-fluid"></div>
2. Grid system
The grid system divides the screen width into 12 evenly For example,
class="col-md-12"
is divided into four categories for different screen sizes, namely:
.col-lg-大屏幕 >1200px .col-md-中等屏幕 992px~1200px .col-sm-小屏幕 750px~992px .col-xs-超小屏幕 <750px
html:
<div class="container"> <div class="row"> <div class="col-lg-3 col-md-6 col-sm-12">好好学习天天向上</div> <div class="col-lg-3 col-md-6 col-sm-12">好好学习天天向上</div> <div class="col-lg-3 col-md-6 col-sm-12">好好学习天天向上</div> <div class="col-lg-3 col-md-6 col-sm-12">好好学习天天向上</div> </div> </div>
css:
<style> div[class^="col"]{ outline-offset: 1px; outline:1px solid red; } </style>
3.Typesetting-Title
<mark></mark> 标记标签 <small></small> 小文本标签/副标题标签
4.Typesetting-Code
<kbd></kbd> 标记通过键盘输入的内容 <code></code> 标记代码内容
5.Table
Add a class name on the basis of the traditional table>tr>td to use the table effects provided by bootstrap
Basic table:
<table class="table"></table>
In< ;b>.table, add the following class names to add corresponding effects
.table-bordered 带边框的 .table-striped 带条纹的 .table-hover 鼠标悬停 .table-condensed 紧缩表格 单元格内的padding值减半
State classes Through these state classes, you can set colors for rows or cells
.active The color set when the mouse is hovering over a row or cell.Success Identifies success or positive action.info Identifies ordinary prompt information or action.warning Identifies warning or requires user attention.danger Identifies danger or potential Actions that bring negative impacts
6. Situational colors (text, buttons, backgrounds, etc.)
Colors will be used in many places in subsequent studies
-default; 默认 -primary; 首选项 -success; 成功(一般用于表达积极向上) -info; 信息 -warning; 警告 -danger; 危险
7. Button
Usually we use input or button tags to write form buttons, and we also use a tags to imitate buttons.
<a class="btn btn-danger" href="">百度一下</a> <input class="btn btn-danger" type="button" value="按钮2"> <button class="btn btn-danger">按钮3</button>
The button has the following skins, or themes, or simply colors:
btn-default; 默认 btn-primary; 首选项 btn-success; 成功(一般用于表达积极向上) btn-info; b 信息 btn-warning; 警告 btn-danger; 危险 btn-link; 连接(a标签的方式)
8. Triangle symbol
You can use the triangle symbol to Indicates that an element has the functionality of a drop-down menu. Note that the triangle symbol in the upward pop-up menu is reversed.
<span class="caret"></span>
9. Close button
By using an icon that symbolizes closure, modal boxes and warning boxes can be made to disappear.
<button type="button" class="close" > <span>×</span> </button>
The above is the detailed content of Bootstrap Tutorial Compilation - Getting Started + CSS Basics. For more information, please follow other related articles on the PHP Chinese website!

JavaScript is widely used in websites, mobile applications, desktop applications and server-side programming. 1) In website development, JavaScript operates DOM together with HTML and CSS to achieve dynamic effects and supports frameworks such as jQuery and React. 2) Through ReactNative and Ionic, JavaScript is used to develop cross-platform mobile applications. 3) The Electron framework enables JavaScript to build desktop applications. 4) Node.js allows JavaScript to run on the server side and supports high concurrent requests.

Python is more suitable for data science and automation, while JavaScript is more suitable for front-end and full-stack development. 1. Python performs well in data science and machine learning, using libraries such as NumPy and Pandas for data processing and modeling. 2. Python is concise and efficient in automation and scripting. 3. JavaScript is indispensable in front-end development and is used to build dynamic web pages and single-page applications. 4. JavaScript plays a role in back-end development through Node.js and supports full-stack development.

C and C play a vital role in the JavaScript engine, mainly used to implement interpreters and JIT compilers. 1) C is used to parse JavaScript source code and generate an abstract syntax tree. 2) C is responsible for generating and executing bytecode. 3) C implements the JIT compiler, optimizes and compiles hot-spot code at runtime, and significantly improves the execution efficiency of JavaScript.

JavaScript's application in the real world includes front-end and back-end development. 1) Display front-end applications by building a TODO list application, involving DOM operations and event processing. 2) Build RESTfulAPI through Node.js and Express to demonstrate back-end applications.

The main uses of JavaScript in web development include client interaction, form verification and asynchronous communication. 1) Dynamic content update and user interaction through DOM operations; 2) Client verification is carried out before the user submits data to improve the user experience; 3) Refreshless communication with the server is achieved through AJAX technology.

Understanding how JavaScript engine works internally is important to developers because it helps write more efficient code and understand performance bottlenecks and optimization strategies. 1) The engine's workflow includes three stages: parsing, compiling and execution; 2) During the execution process, the engine will perform dynamic optimization, such as inline cache and hidden classes; 3) Best practices include avoiding global variables, optimizing loops, using const and lets, and avoiding excessive use of closures.

Python is more suitable for beginners, with a smooth learning curve and concise syntax; JavaScript is suitable for front-end development, with a steep learning curve and flexible syntax. 1. Python syntax is intuitive and suitable for data science and back-end development. 2. JavaScript is flexible and widely used in front-end and server-side programming.

Python and JavaScript have their own advantages and disadvantages in terms of community, libraries and resources. 1) The Python community is friendly and suitable for beginners, but the front-end development resources are not as rich as JavaScript. 2) Python is powerful in data science and machine learning libraries, while JavaScript is better in front-end development libraries and frameworks. 3) Both have rich learning resources, but Python is suitable for starting with official documents, while JavaScript is better with MDNWebDocs. The choice should be based on project needs and personal interests.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Zend Studio 13.0.1
Powerful PHP integrated development environment

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool