修改后效果如下:
手机模板文件:
<div class="xgtBeauty_box">
<div class="xgtBeauty_show">
<{KT id="4" name="网站首页4F热门案例-风格" city_id=$request.city_id limit="2"}>
<a class="xgtBeauty_item" href="<{link ctl='mobile/case:detail' arg0=$item.case_id}>"><img src="<{$pager.img}>/<{$item.thumb}>" /><p><span><{$item.title}></span></p></a>
<{/KT}>
<a class="xgtBeauty_item" href="<{link ctl='mobile/case:items'}>"> <img src="/themes/default/mobile/static/images/xgt1.png" alt=""> </a>
</div>
<ul class="xgtBeauty_list">
<{foreach $attr_values as $v}>
<{if $v@index == 0}>
<li>
<p><{$v.title}></p>
<p>TYPE</p>
</li>
<ul>
<{foreach $v['values'] as $vv}>
<{if $vv@index<6}>
<li><a title="<{$vv.title}>" href="<{$vv.link}>"><{$vv.title}></a></li>
<{/if}>
<{/foreach}>
</ul>
<{/if}>
<{/foreach}>
</ul>
</div>
对应 CSS样式表文件:
/*效果图页面开始*/
.xgtBeauty_box {
margin: 2vw 0;
padding: 0 2vw;
}
/*.xgtBeauty_show{ overflow:hidden;}*/
/************************************/
.xgtBeauty_show:before {
display: table;
content: " ";
box-sizing: inherit;
}
.xgtBeauty_show:after {
display: table;
content: " ";
box-sizing: inherit;
clear: both;
}
/************************************/
.xgtBeauty_show .xgtBeauty_item {
width: 34vw;
height: 19vw;
float: left;
display: block;
position: relative;
margin-left: 1vw;
overflow:hidden;
}
.xgtBeauty_show .xgtBeauty_item:first-child {
width: 60vw;
height: 40vw;
margin-left: 0;
overflow:hidden;
}
.xgtBeauty_show .xgtBeauty_item:first-child img {
width: 100%;
}
.xgtBeauty_show .xgtBeauty_item:last-child {
margin-top: 2vw;
margin-left: 2vw;
}
.xgtBeauty_show .xgtBeauty_item img {
vertical-align: middle;
width: 100%;
border: none; margin-top: 30%;
transform: translateY(-45%);
-webkit-transform: translateY(-45%);
-ms-transform: translateY(-45%);
-moz-transform: translateY(-45%);
}
}
.xgtBeauty_show .xgtBeauty_item>p {
position: absolute;
bottom: 0;
width: 100%;
height: 0.3rem;
color: #fff;
line-height: 0.4rem;
display: block;
text-indent: 0.1rem;
background: -webkit-linear-gradient(bottom, rgba(0,0,0,0.6) 0%, rgba(255,255,255,0) 100%);
}
.xgtBeauty_list {
background-color: #fff;
border-width: 0 0.02rem 0.02rem 0;
padding: 0.2rem 0;
margin-top: 0.1rem;
box-shadow: 0.02rem 0.02rem 0.02rem #e9e9e9;
overflow: hidden;
}
.xgtBeauty_list li {
float: left;
text-align: center;
}
.xgtBeauty_list>li {
width: 20%;
height: 0.4rem;
line-height: 0.2rem;
}
.xgtBeauty_list>ul {
width: 80%;
float: right;
border-left: 0.01rem solid #eaeaea;
overflow: hidden;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.xgtBeauty_list>ul>li {
width: 33.33%;
height: 0.2rem;
line-height: 0.2rem;
}
实现方法:
分别设置效果图图的宽度和高度为vw值。
|
|