html中div定位练习
2015-12-16 19:38
555 查看
html中div定位练习,实现简单的计划列表:
记录div定位时主要的属性:float、position等,以及对应的relative和absolute等,同时使用到angular js中的数据绑定,$http请求等等,记录备忘:
login.css中代码:
/*
主页面数据列表
*/
.planWrite{
background-color: #868383;
margin: 9px;
font-size: 16px;
width: 93%;
height:330px;
}
.plDiv{
width: 32%;
position: absolute;
margin:0px;
border: 1px solid #060606;
}
.plDiv1{
width: 30%;
position: absolute;
margin:0px;
}
#div1_2{
left:1%;
top:60px;
height: 350px;
background-color: #868383;
}
#div2_2{
left:35%;
top:60px;
height: 350px;
background-color: #868383;
}
#div3_2{
left:69%;
top:60px;
height: 350px;
background-color: #868383;
}
#plDiv{
left: 2%;
width: 95%;
height:420px;
margin: 10px;
position: relative;
}
#div1{
height:370px;
left:0px;
top:50px;
background-color: #A4A6A5;
}
#div1_1{
height:50px;
left:0px;
background-color: #060606;
color:#FAF8F8;
font-size: 30px;
font-family: 微软雅黑;
}
#div2{
height:370px;
left:34%;
top:50px;
background-color: #A4A6A5;
}
#div2_1{
height:50px;
left:34%;
background-color: #060606;
color:#FAF8F8;
font-size: 30px;
font-family: 微软雅黑;
}
#div3{
height:370px;
left:68%;
top:50px;
background-color:#A4A6A5 ;
}
#div3_1{
height:50px;
left:68%;
background-color: #060606;
color:#FAF8F8;
font-size: 30px;
font-family: 微软雅黑;
}
/*
planList.html中的代码:
<div id="plDiv">
<center>
<div class="plDiv" id="div1_1">
今日计划
</div>
</center>
<div class="plDiv" id="div1">
</div>
<div class="plDiv1" id="div1_2">
<ul>
<li ng-repeat="plan in plans">{{plan.msgContent}}</li>
</ul>
</div>
<center>
<div class="plDiv" id="div2_1">
今日总结
</div>
</center>
<div class="plDiv" id="div2">
</div>
<div class="plDiv1" id="div2_2">
<!--summary总结-->
<textarea class="planWrite" ng-model="todaySummary"></textarea>
</div>
<center>
<div class="plDiv" id="div3_1">
明日计划
</div>
</center>
<div class="plDiv" id="div3">
</div>
<div class="plDiv1" id="div3_2">
<textarea class="planWrite" ng-model="tomorrowPlan"></textarea>
</div>
</div>
planCtr.js中的代码:
angular.module('contactsApp')
.controller('planCtr',function($scope,$http){
$scope.todaySummary="有总结才知得失";
$scope.tomorrowPlan="有计划才不慌乱";
$http.get("./json/plan.json").success(function(plans){
console.log(plans);
$scope.plans=plans;
});
});
plan.json中的代码:
[
{
"msgContent":"明天会更好"
},
{
"msgContent":"每天进步一点点"
},
{
"msgContent":"总有一个适合你"
}
]
效果图:
记录div定位时主要的属性:float、position等,以及对应的relative和absolute等,同时使用到angular js中的数据绑定,$http请求等等,记录备忘:
login.css中代码:
/*
主页面数据列表
*/
.planWrite{
background-color: #868383;
margin: 9px;
font-size: 16px;
width: 93%;
height:330px;
}
.plDiv{
width: 32%;
position: absolute;
margin:0px;
border: 1px solid #060606;
}
.plDiv1{
width: 30%;
position: absolute;
margin:0px;
}
#div1_2{
left:1%;
top:60px;
height: 350px;
background-color: #868383;
}
#div2_2{
left:35%;
top:60px;
height: 350px;
background-color: #868383;
}
#div3_2{
left:69%;
top:60px;
height: 350px;
background-color: #868383;
}
#plDiv{
left: 2%;
width: 95%;
height:420px;
margin: 10px;
position: relative;
}
#div1{
height:370px;
left:0px;
top:50px;
background-color: #A4A6A5;
}
#div1_1{
height:50px;
left:0px;
background-color: #060606;
color:#FAF8F8;
font-size: 30px;
font-family: 微软雅黑;
}
#div2{
height:370px;
left:34%;
top:50px;
background-color: #A4A6A5;
}
#div2_1{
height:50px;
left:34%;
background-color: #060606;
color:#FAF8F8;
font-size: 30px;
font-family: 微软雅黑;
}
#div3{
height:370px;
left:68%;
top:50px;
background-color:#A4A6A5 ;
}
#div3_1{
height:50px;
left:68%;
background-color: #060606;
color:#FAF8F8;
font-size: 30px;
font-family: 微软雅黑;
}
/*
planList.html中的代码:
<div id="plDiv">
<center>
<div class="plDiv" id="div1_1">
今日计划
</div>
</center>
<div class="plDiv" id="div1">
</div>
<div class="plDiv1" id="div1_2">
<ul>
<li ng-repeat="plan in plans">{{plan.msgContent}}</li>
</ul>
</div>
<center>
<div class="plDiv" id="div2_1">
今日总结
</div>
</center>
<div class="plDiv" id="div2">
</div>
<div class="plDiv1" id="div2_2">
<!--summary总结-->
<textarea class="planWrite" ng-model="todaySummary"></textarea>
</div>
<center>
<div class="plDiv" id="div3_1">
明日计划
</div>
</center>
<div class="plDiv" id="div3">
</div>
<div class="plDiv1" id="div3_2">
<textarea class="planWrite" ng-model="tomorrowPlan"></textarea>
</div>
</div>
planCtr.js中的代码:
angular.module('contactsApp')
.controller('planCtr',function($scope,$http){
$scope.todaySummary="有总结才知得失";
$scope.tomorrowPlan="有计划才不慌乱";
$http.get("./json/plan.json").success(function(plans){
console.log(plans);
$scope.plans=plans;
});
});
plan.json中的代码:
[
{
"msgContent":"明天会更好"
},
{
"msgContent":"每天进步一点点"
},
{
"msgContent":"总有一个适合你"
}
]
效果图:
相关文章推荐
- 望大家互相指教,每个html语言必须的基本结构
- 菜鸟学习中-html:form/html:select
- 基于Scala与正则表达式的Html文本分析应用
- 返回到上一页的html代码的几种写法
- <!doctype html>是什么意思?
- HTML语言中TH和TD有什么区别?
- html 常用标签[3]-表格
- HTML学习中遇到的问题记录
- 菜鸟学习中-end tag "</html:form" is unbalanced
- 处理html页面元素工具类(HtmlAgilityPack.dll)的使用
- strip_tags,htmlspecialchars,htmlentities,stripslashes,addslashes学习小结
- html 中 鼠标滑轮实现横向滚动
- HTML中去除标签之间的行间距
- HTML meta 设置跳转页面
- log在线生成器 html中如何设置浏览器中标题前的logo
- HTML常用标签
- HTML总结II
- HTML总结I
- HTML特殊符号对照表
- HTML中心在页面上弹出自定义表单层(实现可能拖累)