【问题标题】:With Semantic UI React, how to set the width and height for Image Avatar?使用 Semantic UI React,如何设置 Image Avatar 的宽度和高度?
【发布时间】:2017-10-20 04:16:43
【问题描述】:

我正在使用:https://react.semantic-ui.com/elements/image#image-example-avatar

      <Image avatar width={32} height={32} src={'/xxx.jpg'} />

问题是,图像头像没有使用宽度和高度参数,而是使用分配的 CSS:

.ui.avatar.image, .ui.avatar.image img, .ui.avatar.image svg, .ui.avatar.images .image, .ui.avatar.images img, .ui.avatar.images svg {
    margin-right: .25em;
    display: inline-block;
    width: 2em;
    height: 2em;
    border-radius: 500rem;
}

如何使用 Semantic UI React 设置 &lt;Image avatar... &gt; 的宽度和高度?

【问题讨论】:

    标签: reactjs semantic-ui semantic-ui-react


    【解决方案1】:

    头像图像大小与有效字体大小相关。控制有效字体大小的快速方法是

    <Image style={{'font-size':42}} avatar src={'/xxx.jpg'}/>
    

    【讨论】:

      猜你喜欢
      • 2014-04-29
      • 2011-08-06
      • 1970-01-01
      • 2016-09-27
      • 2011-08-20
      • 2017-12-26
      • 1970-01-01
      • 2022-01-21
      • 1970-01-01
      相关资源
      最近更新 更多