京东页面剖析学习

font-size:14px;---overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;----webkit-box-orient: vertical;height: 38px;---word-break: break-all;margin-top: 8px;color: #333;line-height: 1.36;---实现在38px高的标题栏里,显示两行我觉得 字体大小、line-height的控制很微妙
右边下面的 border
我一直以为是通过右边的item border-bottom写出的,所以一直在纠结怎么让左右两栏等高显示
左边
结构是定宽的
图片是自适应的,同时又和右边等高,感觉是撑开了容器高度
首先结构上是 左宽右自适应的
div.cover --固定宽高,float
img--- width:100%
width: 100%;
height: auto;
position: absolute;
top: 0;
left: 0;
div.detail -- 自适应

<div class='container'>-- relative
<span>白条</span>--absolute left
<div class='content'></div>-- padding-left:35px;
</div>
... 是通过.content:after实现的,绝对定位 right
效果是点击 content区域都能实现弹出层的作用;即...没有单独的作用
如果中间栏有第二行,也是写在content里面的;比如这里的现货
同样下面的
也是通过ul:after实现的…

消失的边界线:
京东的实现是 在每一个tabitem后面加上伪类;(不对他最后一个就没有伪类
content: "";
width: 0;
display: block;
border-right: 1px solid red;
position: absolute;
top: 0;
bottom: 0;
right: 0;

类九宫格:
ul
li*9
ul
css:
ul:
position: relative;
font-size: 0;
overflow: hidden;
list-style-type: none;
margin: 0;
padding: 0;
li:
position: relative;
list-style-type: none;
display: inline-block;
float: left;
width: 33.33%;
动态添加after伪类的方式
将伪类定义在动态标签上

这里的✔️就是伪类生成的,
div.option --- 决定按钮结构样式
a 'apple' --- 决定按钮的颜色样式
动态定义伪类的生成,同时还决定了伪类生成在哪里。
.tags_selection .option.selected a::after
