zonelabyrinth / femarkdown Goto Github PK
View Code? Open in Web Editor NEW前端笔记
前端笔记
对于 行内元素
: text-align: center
;
对于确定宽度的块级元素:
width
和margin
实现。margin: 0 auto
;margin-left: -width/2
, 前提是父元素position: relative
对于宽度未知的块级元素
table
标签配合margin
左右auto实现水平居中。使用table标签(或直接将块级元素设值为display:table
),再通过给该标签添加左右margin
为auto
。inline-block
实现水平居中方法。display:inline-block
和text-align:center
实现水平居中。 //translateX
可以移动本身元素宽度的50%。 //兼容性flex
布局使用justify-content:center
行内元素:
line-height
;相对定位
,子级设置 绝对定位
,标签通过margin
实现自适应居中flex
:父级设置display: flex
; 子级设置margin
为auto
实现自适应居中transform
实现table
布局,父级通过转换成表格形式,然后子级设置 vertical-align
实现。(需要注意的是:vertical-align: middle
使用的前提条件是内联元素以及display
值为table-cell
的元素)。块级格式化上下文,是一个独立的渲染区域,让处于BFC内部的元素与外部的元素相互隔离,使内外元素的定位不会相互影响。
IE下为 Layout,可通过 zoom:1 触发
position:absolute/fixed
display:inline-block/table
overflow!==visible2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.