求写图片中的样式 vue中使用,感激不尽,虚心请教不知道该如何是好 阴影部分不知道如何写
这里是CSS样式:
css
.box {
width: 200px;
height: 200px;
background: #fff;
border-radius: 10px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.img {
width: 180px;
height: 180px;
border-radius: 10px;
margin-left: 10px;
margin-top: 10px;
}
.text {
font-size: 20px;
font-weight: bold;
text-align: center;
margin-top: 10px;
}
在Vue中使用:
vue
<template>
<div class="box">
<img class="img" src="./logo.png" />
<p class="text">Shadow</p>
</div>
</template>
<style scoped>
@import './style.css';
</style>
通过`@import './style.css';`导入外部的CSS文件。
阴影的书写在`.box`选择器下,通过`box-shadow`属性设置阴影效果。
希望这个可以帮助到你!如果还有其他问题欢迎提出。