当前位置:网站首页>Practical cases, in-depth analysis

Practical cases, in-depth analysis

2022-06-10 12:18:00 InfoQ

Preface

What is? css A block element ?
Block level elements are displayed on a single line . Its sibling element must not be in the same line as it is ( Unless out of the document stream ). To put it more generally , It's a block element (block element) It's usually the container element of other elements , Can hold other block elements or inline elements .
css Three characteristics of block elements :
  • Each block level element is on its own line , The following elements can only start on another line , It's not possible for two elements to share one line .
  • Height of element 、 Width 、 Row height and top bottom margin can be set .
  • If the width of the element is not set , The default is the width of the parent element .
Element characteristics :
Blocky element

  • Display in a rectangular area on the page .
  • Top down , Monopolize one line
  • You can add width and height directly
  • In general , As a container for other elements or content

Inline elements

  • 《 Analysis of front-end interview questions in large factories +Web Core summary learning notes + Enterprise project actual combat source code + HD explanation of the latest video 》 Free open source Hui Xin search official account 【 Advanced programming 】
      The smallest unit in a page is also a rectangle .
  • Arrange one by one in a row .
  • You can't add width and height directly , Size is supported by content .
  • Inline elements also conform to the rules of the box model , But there are problems with individual attributes (padding-top/bottom margin-top/bottom)
  • When inline elements are arranged in a row , There is a gap between them

In line fast element

  • Width and height can be set .
  • By default , Show them one by one in a row , There is a gap between them .
  • Of the current element display The value is inline-block when , Can support vertical-align attribute .
Common elements :
Blocky element :



Inline elements :



Inline block element :


Element type conversion :
display attribute
: effect : Retrieve or set the box model type generated by the element .

Common attribute values

  • display:block; effect : Turning elements into blocks , It has the characteristics of massive elements . Add : Most of the massive elements , default display The values are all block;
  • display:inline; effect : Turn elements into inline elements , Having the characteristics of inline elements . Add : Most inline elements , default display Value inline;
  • display:none; effect : Hide current , It doesn't take up space .

summary

In order to help you better review the key knowledge 、 More efficient preparation for interview , Special arrangement of 《 Interview manual for front end Engineers 》 Electronic document .

The content includes html,css,JavaScript,ES6, computer network , browser , engineering , modularization ,Node.js, frame , data structure , performance optimization , Projects, etc .

Including Tencent 、 Bytes to beat 、 millet 、 Ali 、 sound of dripping water 、 Meituan 、58、 A lot of spelling 、360、 Sina 、 Sohu and other first-line Internet companies were asked questions in the interview , Covers the beginning of intermediate front-end technology .

null
null
Summary of front-end interview questions

null
[ Open source sharing :【 Analysis of front-end interview questions in large factories + Core summary learning notes + Real project practice + The latest explanation video 】](()

JavaScript

null
performance

null
linux

null
原网站

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/161/202206101211167261.html