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)
- uniapp npm更新到3.0.0-4010420240430001页面控制台报错 HOT 1
- darkmode在ios中覆盖颜色 HOT 1
- uniapp vue2 app端不能使用<component :is="tplComponent"/>动态引入组件吗? HOT 2
- vue3下载nvue页面使用plus.webview.create创建网页后,网页中uni.postMessage会触发报错 HOT 1
- 内置input组件有bug
- HBuilderX 更新到4.14.2024042905-alpha之后,uni.navigateTo 报错 HOT 1
- SocketTask.onError 无法返回errMsg信息,导致错误无法判断
- npx @dcloudio/uvm@latest会更新成alpha版本,easycome模式有问题 HOT 3
- 请教一下vite.config.ts改成vite.config.mts相关问题 HOT 2
- 【屏幕白屏】从4.08.2024040127版本升级到最新版4.15.2024050802或者4.14.2024043013屏幕白屏 HOT 2
- 项目运行出问题
- IOS 蓝牙出现notifyBLECharacteristicValueChange()后在进行蓝牙操作出现断连
- css 变量未生效
- css 变量未生效
- main.ts中的createApp可以是异步函数吗
- scroll-view: TypeError: Cannot read properties of null (reading 'scrollHeight' HOT 4
- H5下 input 组件 v-model 和 @input 事件无效
- canvas h5 事件报错
- 关于打包成h5端分析打包完后的文件为啥每个js都会把uview-ui框架打包进去
- 小程序端如何监听左右滑动? HOT 1
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.