We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
兄弟层级,当上一元素带有阴影,下一元素为rich-text时。rich-text里的图片的层级比阴影高,会显示在阴影上方。
The text was updated successfully, but these errors were encountered:
CSS 的样式及元素的排版规范如此,HTML 中同样如此。 解决的办法: 如果不希望兄弟节点遮挡阴影部分,下一个兄弟节点设置 margin-top 等样式让出相应的高度即可。
以下是测试代码 uni-app
<template> <view class="content"> <view class="shadow"> 这是有阴影的节点 </view> <rich-text :nodes="nodes"></rich-text> </view> </template> <script> export default { data() { return { title: 'rich-text', nodes: [{ name: 'div', attrs: { class: 'div-class', style: 'line-height: 60px; color: red;text-align:center;' }, children: [{ type: 'text', text: 'Hello uni-app!' }, { name: 'img', attrs: { src: 'https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/uni@2x.png' } }] }] } } } </script> <style> .shadow { box-shadow: 10px 10px 5px #888888; } .div-class { margin-top: 10px; } </style>
普通的 HTML
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>test</title> <style type="text/css"> .shadow { box-shadow: 10px 10px 5px #888888; } </style> </head> <body> <div class="shadow">这是有阴影的节点</div> <div> <img src="https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/uni@2x.png"> </div> </body> </html>
Sorry, something went wrong.
No branches or pull requests
兄弟层级,当上一元素带有阴影,下一元素为rich-text时。rich-text里的图片的层级比阴影高,会显示在阴影上方。
The text was updated successfully, but these errors were encountered: