展开
拓展 关闭
订阅号推广码
GitHub
视频
公告栏 关闭

可继承的属性

  • 简介
继承了⽗元素的某些属性
优点:继承可以简化代码,便于维护
  • 默认设置继承的属性
⽂字属性,⽂本缩进、对⻬、⾏⾼
  • 代码案例
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
/* *{
color: red;
} */
.box{
color: red;
font-size: 30px;
font-weight: 700;
font-style: italic;
text-indent: 50px;
text-align: right;
line-height: 80px;
}
</style>
</head>
<body>
<div class="box">
<div>
前端
<div>html</div>
</div>
<div>后端</div>
<div>测试</div>
</div>
</body>
</html>
posted @   DogLeftover  阅读(17)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
· 提示词工程——AI应用必不可少的技术
历史上的今天:
2021-08-31 vue开发:前端项目模板
点击右上角即可分享
微信分享提示