h5+css实现app界面

这篇博客详细介绍了如何利用HTML5和CSS技术来构建应用程序的界面。内容包括了reset.css用于重置浏览器默认样式,main.css用于定义页面的主要样式,set_root.js用于设置根元素的初始状态,以及index.html作为项目的入口文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

效果图

1.reset.css


/*将标签默认的间距设为0*/
body,ul,p,h1,h2,h3,h4,h5,h6,dl,dd,input,selector,form{
    margin: 0;padding: 0;
}

/*让h标签继承body内设置的字体大小*/
h1,h2,h3,h4,h5,h6{
    font-size: 100%;
}


/*去掉默认的列表标签*/
ul{
    list-style: none;
}

/*设置em文字不倾斜*/
em{
    font-style: normal;
}

/*清除下划线*/
a{
    text-decoration: none;
}

/*清除图片的边框*/
img{
    border: none;
}

/*清楚margin-top塌陷和浮动问题*/
.clearfix:before,.clearfix:after{
    content: "";
    display: table;
}

.clearfix:after{
    clear: both;
}
/*解决ie清楚浮动的问题*/
.clearfix{
    zoom: 1;
}

/*向左浮动*/
.fl{
    float: left;
}
/*向右浮动*/
.fr{
    float: right;
}

2.main.css

body{
    font-family: 'Microsoft Yahei';
    color: #666;
}

.main_wrap{
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background-color: gold;
}

/*顶部标题栏*/
.header{
    height: 2.5rem;
    background-color: #37ab40;
    position: relative;
}
.header .logo{
    display: block;
    width: 4.45rem;
    height: 1.8rem;
    margin: 0.35rem auto 0;
}

.header .logo img{
    width: 100%;
}

.header .search{
    position: absolute;
    width: 1.35rem;
    height: 1.35rem;
    right: 0.75rem;
    top: 0.625rem;
    background: url("../image/icons.png") left top;
    background-size: 3rem 42rem;
}

.center_wrap{
    position: absolute;
    left: 0;
    right: 0;
    top: 2.5rem;
    bottom: 2.5rem;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #efefef;
}
.slide img{
    width: 100%;
}

.menu_con{
    height:9.25rem;
    background-color:#fff;
    margin-top:0.5rem;
    overflow:hidden;
}

.menu{
    width:19rem;
    height:8.1rem;
    margin:0.7rem 0 0 1.375rem;
}

.menu li{
    width:2.8rem;
    height:4.1rem;
    float:left;
    margin-right:1.625rem;
}

.menu li a{
    display:block;
    width:2.8rem;
    height:2.8rem;
    background:url(../image/icons.png) left -3rem no-repeat;
    background-size:3rem 42rem;
}

.menu li h2{
    height:1.3rem;
    font:13px/1.3rem 'Microsoft Yahei';
    color:#666;
    text-align:center;
}


.menu li:nth-child(2) a{
    background-position:left -6rem;
}
.menu li:nth-child(3) a{
    background-position:left -9rem;
}
.menu li:nth-child(4) a{
    background-position:left -12rem;
}
.menu li:nth-child(5) a{
    background-position:left -15rem;
}
.menu li:nth-child(6) a{
    background-position:left -18rem;
}
.menu li:nth-child(7) a{
    background-position:left -21rem;
}
.menu li:nth-child(8) a{
    background-position:left -24rem;
}

.common_
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值