Comments (1)
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/[email protected]'
}
}]
}]
}
}
}
</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/[email protected]">
</div>
</body>
</html>
from uni-app.
Related Issues (20)
- hbuilder中可以一次性导入所有的uni-ui吗,就是unimodules HOT 1
- video后续支持字幕么
- uniapp支持文件断点下载么
- 微信小程序报错 TypeError: t.$callHook is not a function
- @dcloudio/uni-app@vue3 自定义组件使用插槽接收参数时会生成一个空view HOT 1
- 移动端video如何播放本地m3u8文件
- 可视化创建的项目,怎么总报错啊
- uni.uploadFile 在华为手机鸿蒙4.X系统上,上传到开发服务器上,httpStatus=0,导致无法上传 HOT 1
- 抖音小程序添加了【配置行业 SDK 的权限】,需要对编译后的文件手动增加配置项
- BackgroundAudioManager 监听原生 onPrev 事件不触发
- 新增对vite5的支持 HOT 2
- 新增对vue3.4的支持 HOT 2
- 不是bug HOT 2
- Uni-App 什么时候支持华为“鸿蒙应用”和“元服务”呢?
- 抖音 动态循环里的 if 里的 ref 无法获取到虽然按照 https://github.com/dcloudio/uni-app/issues/4554 这个方法解决了;但是带来了新的问题:自定义组件变成页面了。
- input type=text Error HOT 1
- 小程序误报 Property "xx" was accessed during render but is not defined on instance HOT 4
- uniapp vue3 最新版本sdk打包的小红书小程序为何每次返回会自动刷新页面?
- uni-app ios真机debug 控制台报错
- uni-app android SDK下载困难
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uni-app.