Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

span背景色不生效 #57

Closed
pipti opened this issue Aug 19, 2024 · 3 comments
Closed

span背景色不生效 #57

pipti opened this issue Aug 19, 2024 · 3 comments

Comments

@pipti
Copy link

pipti commented Aug 19, 2024

同标题

@pipti
Copy link
Author

pipti commented Aug 20, 2024

应该是span外面包一层块标签就不显示背景,例如

fffffff

,或者
fffffff

@asasugar
Copy link
Owner

asasugar commented Sep 13, 2024

确实存在这个问题🥲

  1. 因为html中的行内标签是通过鸿蒙的 Span 来渲染的,但是 Span 不支持设置背景色;
  2. 另外,如:<span style="background-color: red">我是带背景色的span标签</span>111 ,111 也会被渲染到红色背景中,因为背景色值是设置在Text 标签中,实际被渲染成:
    Text(){ Span('我是带背景色的span标签') Span('111') }.backgroundColor('red')
    暂时没想到好的解决方案,尽量先避免吧

@asasugar
Copy link
Owner

确实存在这个问题🥲

  1. 因为html中的行内标签是通过鸿蒙的 Span 来渲染的,但是 Span 不支持设置背景色;
  2. 另外,如:<span style="background-color: red">我是带背景色的span标签</span>111 ,111 也会被渲染到红色背景中,因为背景色值是设置在Text 标签中,实际被渲染成:
    Text(){ Span('我是带背景色的span标签') Span('111') }.backgroundColor('red')
    暂时没想到好的解决方案,尽量先避免吧

计划改造 Span 渲染,将会支持这个,主要使用标签 ContainerSpan
#13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants