V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
wktrf
V2EX  ›  CSS

这个文字和图片不居中应该如何处理?

  •  
  •   wktrf · Aug 20, 2018 · 1448 views
    This topic created in 2808 days ago, the information mentioned may be changed or developed.

    HTML 代码

    <View className='user-info'>
       <Image className='user-icon' src={this.props.user.data.avatarUrl} />
       <Text className='user-name'>&nbsp;{this.props.user.data.nickName}</Text>
    </View>
    

    CSS 代码

     .user-info
       padding 10px
       outline 1px solid red
       margin-top 40px
       image
         width 72px
         height 72px
         border-radius 72px
         vertical-align middle
    

    写出来是这样的 图片

    2 replies    2018-08-20 18:25:20 +08:00
    U7Q5tLAex2FI0o0g
        1
    U7Q5tLAex2FI0o0g  
       Aug 20, 2018
    网上搜一下解决方法一大堆。请善用搜索。
    abelmakihara
        2
    abelmakihara  
       Aug 20, 2018
    line-height 72px
    flex
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5512 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 115ms · UTC 09:19 · PVG 17:19 · LAX 02:19 · JFK 05:19
    ♥ Do have faith in what you're doing.