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":"总有一个适合你"
}
]

效果图:

html中div定位练习的更多相关文章

  1. 网页制作过程中div定位的三个问题

    这几天要做单位的网站,对于做网站我也不怎么样,于是我便在网上参考了一个比较满意的网站,套一下来把这个工作结束了.在此期间遇到了三个关于div定位问题, 一般网站用div布局时都是从上到下分head . ...

  2. jQuery ZeroClipboard中Flash定位不准确的解决方案

    转自波斯马,原文地址<jQuery ZeroClipboard中Flash定位不准确的解决方案> jQuery ZeroClipboard支持在多种浏览器中复制内容到剪贴板,IE.Fire ...

  3. (转载)html中div使用自动高度

    为什么要使用div标签 1.更多的配置项,那就意味着更灵活,当然,难度也更高: 2.可以方便的容纳其他html标签:     static定位就是不定位,出现在哪里就显示在哪里,这是默认取值,只有在你 ...

  4. CSS中的定位与浮动

    CSS中的定位与浮动 本文主要讲述CSS中的三种定位样式static.relative和absolute的区别以及浮动元素的特征. 定位样式 CSS中定位样式position的取值有三个,默认值:st ...

  5. 关于CSS中的定位使用子绝父相(子类绝对位置和父类相对位置)

    关于CSS中的定位使用子绝父相(子类绝对位置和父类相对位置) 欢迎转发,但是请填写原博客地址https://www.cnblogs.com/JNovice/p/9536910.html  前言:最近在 ...

  6. 【基础】selenium中元素定位的常用方法(三)

    一.Selenium中元素定位共有八种 id name className tagName linkText partialLinkText xpath cssSelector 其中前六种都比较简单, ...

  7. css中的定位属性position(转)

    css中的定位属性position   同样的也是上课的时候发现学生难以理解的一些问题拿出来记录一下,希望帮助初学者. 在css中定位属性position的运用在页面中是很常用的,特别是一些结合js来 ...

  8. CSS中的定位机制

    CSS3 中有三种定位机制 : 普通文档流 (text)| 浮动(float) | 定位(position) 普通文档流 就是CSS中默认的文本文档 普通流中,元素位置由文档顺序和元素性质决定,块级元 ...

  9. div定位relative和absolute测试2

    之前的博文:div定位relative和absolute测试1.中,body包含了蓝色和红色div,蓝色的相对定位,相对于body向下偏移了10px位置,红色绝对定位,相对浏览器偏移了10px位置. ...

随机推荐

  1. ZPPR016-在制品清单报表

    *&---------------------------------------------------------------------**& Report ZPPR016*&a ...

  2. HOG特征(Histogram of Gradient)总结(转载)

    整理一下我个人觉得比较好的HOG博文 博文1:OpenCV HOGDescriptor: 参数与图解 http://blog.csdn.NET/raodotcong/article/details/6 ...

  3. Testing Round #8 A. IQ Test 水题

    题目链接:http://codeforces.com/problemset/problem/328/A 这道题目wa了一次,注意这句话: You should also print 42 if the ...

  4. Android——进度对话框

    java类代码: //普通进度对话框 public void bt8_onClick(View v) { final ProgressDialog progressDialog = new Progr ...

  5. 配置DNS

    1.将DNS解析服务器添加到:/etc/resolv.conf 2.打开DNS相关配置:sed -i 's/^hosts:[ \t]*files[ \t]*$/& dns/' /etc/nss ...

  6. C++实现水波纹、火焰和血浆效果

    点击这里查看原文 Code Project着火了! 整个工程有三个类,它们可以让你在图象上添加一些很酷的效果. 我把这些文件都放到我的代码压缩包里面了,并且做了一个小工程来让一些人使用起来更方便,但是 ...

  7. linux查找目录下的所有文件中是否含有某个字符串

    查找目录下的所有文件中是否含有某个字符串 find .|xargs grep -ri "IBM" find .|xargs grep -ri "IBM" -l ...

  8. nginx无法启动: libpcre.so.1/libpcre.so.0: cannot open shared object file解决办法

    NGINX启动时提示错误: /usr/local/nginx/sbin/nginx -t/usr/local/nginx/sbin/nginx: error while loading shared ...

  9. HttpWebRequest's Timeout and ReadWriteTimeout — What do these mean for the underlying TCP connection?

    http://stackoverflow.com/questions/7250983/httpwebrequests-timeout-and-readwritetimeout-what-do-thes ...

  10. dede后台栏目文章问题

    栏目下的子栏目文档,并不记在主栏目文档数中,让我一直以为程序错误.