Comparison of some properties in css

In CSS, some similar properties are inevitably confusing and different. Now pull them out and compare them.

1.rgba vs opacity

rgba: only works on the element itself

opacity: not only on the element itself, but on everything within the element

 

2.alt vs title

alt: Specifies the replacement text for the element that sets this attribute, the language of the replacement text is specified by the lang attribute, the user agent when the image cannot be displayed

title: Provides constructive information for the element that sets this attribute

 

3.readonly vs disabled

readonly: Only valid for inputs with text fields, the value can be submitted as an item of the form, and the focus can be obtained

disabled: valid for all inputs, the value cannot be submitted, and cannot be focused

 

4.block vs inline-block vs inline

block: block-level element, width and height can be set, exclusive line (div/p/h1/ul, etc.)

inline-block: Inline block element, width and height can be set, not exclusive to one line (img/iniput/textarea/button, etc.)

inline: inline element, cannot set width and height, does not occupy a line (a/span/em, etc.)

 

5.src vs href

src: is the abbreviation of source, which points to the location of external resources. It will terminate the download of other resources when requested, so it is generally placed at the bottom of the html file.

href: is the abbreviation of Hypertext Reference, which points to the location of network resources, and will be downloaded in parallel when requested, so it can be placed in the head of html

 

6.  vs   vs  

 : Awesome space, the space generated by pressing space, the occupation width is affected by the font

 : Evil space, occupying a width of 1/2 Chinese width, basically not affected by fonts

 : Devil space, occupying a width of 1 Chinese width, basically not affected by fonts

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325302725&siteId=291194637
Recommended