css中常用词汇

admin 轻心小站 关注 LV.19 运营
发表于前端技术学习版块 css,教程

CSS(Cascading Style Sheets)是前端开发中必不可少的一项技术,它为网页赋予了更加优秀的视觉效果和用户体验。下面就是一些CSS中常用词汇的介绍。 // 选择器 div, p, h

CSS(Cascading Style Sheets)是前端开发中必不可少的一项技术,它为网页赋予了更加优秀的视觉效果和用户体验。下面就是一些CSS中常用词汇的介绍。

// 选择器
div, p, h1 {
  color: blue;
}

/* 属性 */
font-size: 16px;
border: 1px solid #000;
background-color: #fff;

// 值
color: red;
padding: 20px;
margin-top: 10px;

/* 盒模型 */
.box {
  width: 100px;
  height: 100px;
  padding: 10px;
  border: 1px solid #000;
  margin: 20px;
}

/* display属性 */
display: block;
display: inline;
display: inline-block;

// 定位
position: relative;
position: absolute;
position: fixed;

/* 伪类 */
a:hover {
  color: red;
}
input:focus {
  background-color: #ccc;
}

/* 媒体查询 */
@media only screen and (max-width: 768px) {
  /* 样式 */
}

/* 动画 */
@keyframes move {
  from {
    left: 0;
  }
  to {
    left: 100px;
  }
}
.box {
  animation: move 1s linear infinite;
}

// 继承性
.parent {
  color: green;
}
.child {
  /* 继承父元素color属性 */
} 

以上就是CSS中常用的一些词汇的介绍了。了解这些词汇可以帮助我们更好地理解样式的使用和优化,从而打造更加优秀的网页。

文章说明:

本文原创发布于探乎站长论坛,未经许可,禁止转载。

题图来自Unsplash,基于CC0协议

该文观点仅代表作者本人,探乎站长论坛平台仅提供信息存储空间服务。

评论列表 评论
发布评论

评论: css中常用词汇

粉丝

0

关注

0

收藏

0

已有0次打赏