css inline-block elements of the align

  The most kind-hearted moments in life , like water and bright , the memory it was always sitting beside him , stroking my withered shoulders , told me that the red should not be forgotten.

 

  Sorry, beside the point.

  When multiple elements of the same line style for  display: inline-block   time , the situation of the elements can not be aligned due to inconsistencies in the type of content, there is a picture, in the case of text, or an empty label, may occur

  as follows:

  

 

 

   

  analysis

  Alignment is performed based on elemental analysis and alignment

 

  element

    Inline elements display: inline from left to right next to one another , the contents of package elements , can not be set high width

    Block-level elements display: block on a separate line , can be set width and height

    Inline block-level elements display: inline-block is compatible with both of the above properties

 

  Alignment

    CSS syntax: vertical-align

    grammar:

      baseline | sub | super | top | text-top | middle | bottom | text-bottom | <percentage> | <length> | inherit

    Description:

      Setting the vertical alignment of the element content.

    parameter:

      baseline: Baseline alignment; take as a reference the maximum line height

      sub: the scale display;

      super: superscript display;

      top: top alignment;

      text-top: top alignment of the text;

      middle: central alignment;  

      bottom: bottom alignment;

      text-bottom: bottom alignment of the text;

      Percentage and length: the CSS2, it may be negative.

    Initial value: Baseline

    Inherited: no inheritance

 

    The blank baseline inline-block elements or picture elements to the lower edge of the element

 

    Therefore, the baseline can be modified element is aligned with

 

Guess you like

Origin www.cnblogs.com/pengsn/p/12288398.html