How can I make the width of my
match the width of the >

前端 未结 5 1176
庸人自扰
庸人自扰 2020-12-07 22:16

Say, I got this code:

\"An
5条回答
  •  南方客
    南方客 (楼主)
    2020-12-07 22:45

    Another solution: Use Intrinsic width

    Just set width: min-content; on the figure element

    DEMO (Except for IE)

    figure {
      width: -webkit-min-content;
      width: -moz-min-content;
      width: min-content;
    }
    An image of a bunny rabbit.
    Bunny rabits are cuddly and fluffy creatures with big ears. They eat carrots.

    NB: Browser Support is OK, except for IE, however they are considering implementing this

提交回复
热议问题