font和lineheight冲突。

本文探讨了在网页设计中,使用font样式设置字体大小和粗细时,line-height属性的有效性。通过实例演示,解释了如何正确应用这些CSS属性以达到预期的布局效果。

font:14px bold arial;

line-height:40px;

这样写font的话line-height不会有效,只要把font拆分写就有效,chrome ie ff下都是。

转载于:https://www.cnblogs.com/strangerqt/p/3871672.html

@Entry @Component struct Index { @State message: string = '学鸿蒙来黑马'; build() { Column() { //顶部区域 Row(){ Image($r('app.media.jd_cancel')) .width(20) Text('帮助') } .width('100%') .justifyContent(FlexAlign.SpaceBetween) //logo图标 Image($r('app.media.jd_logo')) .width(250) .height(250) } //国家/地址(自己画) Row(){ Text('国家/地址') .layoutWeight(1) .fontColor('#666') Text('中国(+86)') .fontColor('#666') Image($r('app.media.jd_right')) .width(20) .fillColor('#666') } .padding({left:15,right:10}) .width('100%') .height(40) .backgroundColor('#fff') .borderRadius(20) //手机号(输入框) TextInput({ placeholder:'请输入手机号' }) .placeholderColor('#666') .height(40) .borderRadius(20) .backgroundColor('#fff') .margin({top:20}) //已阅读并同意 Row(){ Checkbox() .width(10) .margin({top:7}) //一段文本中, Text(){ Span('我已经阅读并同意') Span('《京东隐私政策》').fontColor('#3274f6') Span('《京东用户服务协议》').fontColor('#3274f6') Span('未注册的手机号将自动创建京东账号') } .fontSize(12) .fontColor('#666') .lineHeight(20) } .alignItems(VerticalAlign.Top) //登录 Button('登录') .width('100%') .backgroundColor('#bf838') .margin({top:25}) //新用户注册等链接 Row({space:25}){ Text('新用户注册登录').fontSize(14).fontColor('#666') Text('账号密码登录').fontSize(14).fontColor('#666') Text('无法登陆').fontSize(14).fontColor('#666') } .margin({top:15}) .padding(20) .width('100%') .height('100%') .backgroundColor(Color.Pink) .backgroundImage($r("app.media.jd_login_bg")) .backgroundImageSize(ImageSize.Cover) } }请帮我更改这段代码,使得其可以运行,同时,显示返回给我的代码不要向上次一样省略,我需要直接复制黏贴到编译器中
03-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值