css - 如何使用 CSS 为图片添加边框和阴影?
问题描述
显然我不知道我在做什么,需要很多帮助。正如我在标题中所说,我想为图片添加边框和阴影。
<!DOCTYPE html>
<!-- Instructions: Replicate the same styling seen in the kitten image below. -->
<html>
<head>
<title>Style an Image Quiz</title>
<style>
.kitten-Image{
/*border: medium dashed #fa8072*/
}
-webkit-box-shadow: 0px 0px 64px 0px rgba(0,0,0,0.72);
-moz-box-shadow: 0px 0px 64px 0px rgba(0,0,0,0.72);
box-shadow: 0px 0px 64px 0px rgba(0,0,0,0.72);
</style>
</head>
<body>
<img src=https://www.aspca.org/sites/default/files/blog_foster-myth_062718_main.jpg>
</body>
</html>
解决方案
.kitten-Image{
border: 5px dashed #fa8072;
box-shadow: 0px 0px 64px 0px rgba(0,0,0,0.72);
}
Your imgae needs to have a class. and also you need to uncomment styles.
<img class="kitten-Image" src=https://www.aspca.org/sites/default/files/blog_foster-myth_062718_main.jpg>
推荐阅读
- flutter - 如何更改 Flutter 中提升按钮的选定文本的颜色?
- python - 如何从 Pandas 中的一行中删除数据?
- typescript - 类型区分在函数模板参数中不起作用
- java - 如何在 Java 中对 HashMap 的 ArrayList 使用包含方法?
- tcp - Unity TCP 请求到达服务器客户端的数量与执行的客户端数量一样多
- python - TypeError:DriverAction() 得到了一个意外的关键字参数“nargs”
- fonts - 从代码发送电子邮件:在 Gmail 的电子邮件中使用 Google 字体
- postgresql - 无法使用 CMD 或入口点覆盖命令
- javascript - 使用 moment.js 检查本地时间是否在其他 2 个时区时间之间
- jenkins - 循环变量未传递给 Jenkins 中的 shell 脚本