简体   繁体   中英

Why does media-body class in bootstrap have width 10,000px and media class have overflow hidden and zoom 1?

I have some question regarding the media classes in bootstrap.

  1. Why does .media-body class in bootstrap have width 10,000px? Why did they use display: table-cell not display: block ?
  2. Why is overflow: hidden and zoom: 1 used on .media class?
  3. Why doesn't the div with .media-body actually take 10,000px width?
  4. What would happen if overflow: hidden and zoom: 1 are not used in .media class?

As for my effort, I removed overflow, zoom and 10,000px width and observed no difference.

I have found some comments in the collection " Responsive Bootstrap ":

/*
 * 1. Create new block formatting context in modern browsers
 * 2. Avoid shrink-wrap behaviour of table-cell
 * 3. Override for IE6/7
 * 4. Create new block formatting context in IE6/7
 * Alternatively, use 'overflow:hidden' if clipping is OK
*/
display: table-cell; /* 1 */
width: 10000px; /* 2 */
@include old-ie() {
    *width: auto; /* 3 */
    *zoom: 1; /* 4 */
}

UPD

*zoom is a hack for IE6 and IE7. All browsers ignore attributes that begin with an asterisk. Only IE7 and below takes them into account.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM