Cascading Style Sheets Tutorial

Display: inline-block attributes

  CSS to achieve performance in the use of the time, this property will feel very confused and ambiguous. 

  Display: inline-block 
  Submit to the will of the target object, but the object content as a block objects filed.    Within the next target will be filed in the same line, allowing space.    But for this property is not all browsers identification. 

  Supported browser: Opera, Safari 

  I regret that the most popular IE and Firefox does not support this property (said to the next version of Firefox will support display: inline-block).    But there are private property under Firefox - moz-inline-box and inline-block shape, why is the "shape" rather than "Spirit"?    This is because the use - moz-inline-box will bring a lot of unexpected side effects, such as the use of this attribute, text-align sometimes then there will be problems, it has to switch to Firefox's private property - moz-box-align to solve (Thank you aoao provide case). 

  Recommendations: It is best not to use Firefox private property - moz-inline-box. 

  Perhaps the friend mentioned above will not support IE display: inline-block attributes that doubt or opposition.    Said: "I am in IE or in a span of the elements such as the use of display: inline-block has been effective." 

  In actual fact, in IE use elements of the internal display: inline-block, IE is not identified, but the use of display: inline-block under the IE would trigger layout (if you feel the unfamiliar layout, the translation can see old9 "On having layout"), so that in conjunction with the display elements: inline-block attributes of the table.    From the above analysis, not difficult to understand why IE, block elements of the display settings: inline-block property can not be achieved inline-block results.    Then block element is only display: inline-block triggered a layout, and it is to this layout, triggered after block layout elements still the trip, and not block elements such as Opera in the presentation of the object. 

  Extension of a question: IE elements of how to achieve the next block display: inline-block effect? 

  There are two ways: 

  1, the first use of display: inline-block attributes trigger block elements, and then the definition display: inline to block the submission of the elements within the target (two to have on display two CSS statement only effect of this is IE a classic bug, if the first definition of the display: inline-block and then set to display inline or block, the layout will not disappear).    Code as follows: (… other attributes content omitted): 

  Div (display: inline-block ;…} 
  Div (display: inline;) 

  2, block elements directly within the target set for the submission of (attribute settings display: inline), and then trigger the layout block elements (such as: zoom: 1).    Code as follows: 

  Div (display: inline; zoom: 1 ;…} 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • DotNetKicks
  • DZone

Tags: css attributes, css display, Display, xhtml attributes

Releated Posts

  • CSS Case Analysis and Display Visibility different attributes
  • CSS in-depth understanding of the display: inline-block attributes
  • CSS Tutorial 13, the CSS display attributes [Translation Htmldog]
  • CSS achieve dynamic display by the five-pointed star-level results
  • CSS primary entry: text attributes

This entry was posted on Tuesday, December 11th, 2007 at 12:00 am and is filed under CSS Properties. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

« Web2.0 true lies
Web2.0 traditional enterprises to promote the depth of the times »

Leave a Reply

  • Categories

    • CSS Properties (491)
    • CSS Tutorial (1154)
    • CSS Tutorial By Examples (1201)
    • Css+Div Web Design (3274)
    • Xhtml and Web Design (1797)
  • Archives

    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • January 2007
  • Pages

    • About us

Cascading Style Sheets Tutorial