美文网首页
Css内容复习随笔

Css内容复习随笔

作者: 一书文集 | 来源:发表于2018-11-24 23:27 被阅读6次
  • Em 基于父元素的字体大小

: :: 单冒号 双冒号区别 低版本浏览器支持: 高版本都支持默认将:变为::, h5规范为::

/*
    参数1:x轴的偏移
    参数2:y轴的偏移
    参数3:阴影的模糊的
    参数4:阴影的延伸
    参数5:阴影的颜色
    参数6:内阴影
    */
    box-shadow: 0 -2px 2px #d8d8d8 inset;
  • 特殊样式
image.png
.product_box.active::before{
    content: "\e915";
    position: absolute;
    left: 0;
    top: -7px;
    font-family: wjs;
    font-size: 33px;
} 
.product_box .pro_right::before,
.product_box .pro_right::after{
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 6px;
    background: #f5f5f5;
    left: -6px;
}
.product_box .pro_right::before{
    top: -6px;
    /*
    参数1:x轴的偏移
    参数2:y轴的偏移
    参数3:阴影的模糊的
    参数4:阴影的延伸
    参数5:阴影的颜色
    参数6:内阴影
    */
    box-shadow: 0 -2px 2px #d8d8d8 inset;
}
.product_box .pro_right::after{
    bottom: -6px;
    box-shadow: 0 2px 2px #d8d8d8 inset;
}



  • 选择器

找到P元素,通过P找到父元素,通过父元素找子元素当中类型为P的,然再去找第几个。
p:first-of-type
p:last-of-type
p:nth-of-type(n)
p:nth-last-of-type(n)
如果使用的是child;
p:first-child
找到P元素,通过P找到父元素,通过父元素找所有的子元素,找第一个元素,匹配判断类型(如果不是无效选择器)

  • 加入元素不影响其他区块?


    image.png
.product_box .pro_right .tips{
    position: absolute;
    left: 0;
    top: 10px;
    width: 100%;
}
.product_box .pro_right .tips span{
    width: 16px;
    height: 16px;
    text-align: center;
    line-height: 16px;
    border-width: 1px;
    border-style: solid;
    display: inline-block;
}
.product_box .pro_right .tips .red{
    color: red;
    border-color: red;
}
.product_box .pro_right .tips .green{
    color: green;
    border-color: green;
}
.product_box .pro_right p:first-of-type{
    margin-top: 25px;
    color: #e92322;
}
.product_box.active .pro_right p:first-of-type{
    color: #fff;
}
.product_box .pro_right p:first-of-type b{
    font-size: 48px;
}
.product_box .pro_right p:first-of-type sub{
    bottom: 0;
    font-size: 12px;
}
.product_box .pro_right p:last-child{}

  • ul默认会有编剧 padding 0

相关文章

  • Css内容复习随笔

    Em 基于父元素的字体大小 : :: 单冒号 双冒号区别 低版本浏览器支持: 高版本都支持默认将:变为::, h5...

  • CSS的学习记录(一)

    ------ 本文为回顾复习,只记录部分内容,仅供参考 ------ 本文包括以下css内容: id和class的...

  • 复习css

    css选择器 id 选择器 #red {color:red;} 类选择器 .center {color:r...

  • CSS复习

    解决文字对齐 多行文本省略: 文字垂直居中 margin(外边距)合并 div的高度是由他内部文档流中元素高度总和...

  • css复习

    块级元素的时候可以不用在宽度上加100%,块级元素本来就是撑开的,加上之后会把内容撑出去 父子元素,如果子元素有外...

  • 复习CSS

    互联网前端分为三层:结构,样式,行为 HTML 超文本标记语言 从语义的角度上描述页面的结构CSS 层叠样式...

  • css复习

    不一定要记到繁多的样式。实际上只要通过辅助工具就可以了。样式规则选择器:HTML元素选择器Class选择器Id选择...

  • CSS复习

    基本布局 绝对布局 主内容随页面宽度,固定边栏 缺点:浏览器变宽的时候,页脚可能会遮住边栏,同时浏览器变宽后,主内...

  • 复习CSS

    居中对齐 inline元素 block元素 水平居中,知道宽度,左右margin为auto 定位元素 知道元素尺寸...

  • 前端复习第二周

    主要复习CSS,style来引入css,link来外联css文件 优先级标签内css优先级 > hand内部css...

网友评论

      本文标题:Css内容复习随笔

      本文链接:https://www.haomeiwen.com/subject/yuzeqqtx.html