当前位置:首页 >> CMS教程 >> css-js-html

写静态页面时一些通用的代码段 引用 居中 banner 三角 圆点 列表

来源:本站 发布时间:2023-12-17 09:49:33 热度:195 ℃

一、无障碍操作

<div id="barrierfree_container">
 <div class="oldStyle container">

 </div>
</div>
<script id="barrierfree" src="/module/jslib/accessiblereading/load.js"></script>

二、引用

<link rel="stylesheet" href="images/common.css">
<link rel="stylesheet" href="images/index.css">
<script src="images/jquery.js"></script>

三、块居中

.w {
    width: 1200px;
    margin: 0 auto;
}

四、banner

/*banner*/
.banner_bg {
    width: 100%;
    height: 300px;
    background("banner.jpg") no-repeat;
    background-size: 100% 100%;


五、三角

/*三角图标*/
.sanjiao {
    width: 0;
    height: 0;
    border-top: 7px solid #2053e4;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid transparent;


六、小圆点

/*小圆点*/
.element::before {
    position: absolute;
    content: '';
    width: 6px;
    height: 6px;
    background-color: #acc2d4;
    left: 0;
    top: 33px;
    border-radius: 50%;
}



七、手机端适配

/*手机端适配*/
/*500px以下显示的*/
@media only screen and (max-width:500px) {

}

/* 480 768 992 1220 1920  */

/*320px以上显示的*/
@media screen and (min-width: 320px) {

}
/*480px以上显示的*/
@media screen and (min-width: 480px) {

}
/*768px以上显示的*/
@media screen and (min-width: 768px) {

}
/*992px以上显示的*/
@media screen and (min-width: 992px) {

}
/*1200px以上显示的*/
@media screen and (min-width: 992px) {

}



八、列表结构

<ul>
 <li>
  <a href="#">
             <span class="list_name"></span>
             <span class="list_time"></span>
         </a>
     </li>
</ul>

九、列表样式

.element ul li {
    width: 100%;
    height: 60px;
    line-height: 60px;
    padding: 0 10px;
    border-bottom: 1px dashed #2577ff;
}
.element ul li a {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.list_name {
    color: #404040;
    width: 75%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


 

上一篇:没有了!

下一篇:html css js 禁止右键代码

如果你的问题还没有解决,点击qq群50604130 加入交流群一起学习交流。支持与鼓励站长,请扫码赞赏一下站长最后那几根倔强的头发。

  • 微信支付

    微信扫一扫

  • 支付宝支付

    支付宝扫一扫

交流学习

加入VIP即可下载全部模板;2天更新1套模板

年VIP:199元(金牌)

终身VIP:99元(钻石)限时特惠

  • QQ号

    Q:798088888

  • QQ号

    Q群:50604130

  • 添加微信客服

    微信客服

热门标签
 
QQ在线咨询
售前客服
仿站/建站