position_fixed固定在某一个页面上

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.pg_head{
height: 60px;
background-color: black;
color: white;
position: fixed;
/*position头部固定*/
top :0;
left:0;
right:0; }
.pg_body{
background-color:#dddddd;
height: 5000px;
margin-top: 20px;
}
</style>
</head>
<body>
<!--position fixed-->
<div class="pg_head"> 头部</div>
<div class="pg_body">内容</div>
</body>
</html>

position_fixed 固定在某一个页面上

position中 relative和 absolute的结合使用

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Title</title> </head>
<body>
<div style="position: relative;width: 500px;height: 200px;border: 1px solid red;margin: 0 auto;">
<div style="position: absolute;left:0;bottom:0;width: 50px;height: 50px;background-color: black;"></div>
</div>
<div style="position: relative;width: 500px;height: 200px;border: 1px solid red;margin: 0 auto;"> <div style="position: absolute;right:0;bottom:0;width: 50px;height: 50px;background-color: black;"></div>
</div>
<div style="position: relative;width: 500px;height: 200px;border: 1px solid red;margin: 0 auto;"> <div style="position: absolute;right:0;top:0;width: 50px;height: 50px;background-color: black;"></div>
</div>
</body>
</html>

position中 relative和 absolute的结合使用

 IE浏览器显示图片是有蓝色边框的

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
img {
border: 0;
}
</style>
</head> <body>
<div> <!--默认img图片有蓝色的边框,如果border: 0;就可以去掉-->
<a href="http://www.baidu.com">
<img src="7.png" style="width: 820px; " alt="mei"/>
<!--或者-->
<img src="7.png" style="width: 820px;border: 0; " alt="mei"/>
</a>
</div>
</body>
</html>

IE浏览器显示图片是有蓝色边框的如何去掉

overflow图片显示不完全,现实滚动条

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<!--<div style="width:100px;height: 100px; overflow: hidden">-->
<!-- 按外面的大小隐藏图片大小overflow: hidden-->
<div style="width:100px;height: 100px; overflow: auto">
<!--图片大小带滚动条overflow: auto-->
<div>
<a><img src="7.png"/></a>
</div>
</div>
</body>
</html>

overflow图片显示不完全,现实滚动条

python :HTML+CSS (Position)的更多相关文章

  1. Python:程序练习题(二)

    Python:程序练习题(二) 2.1温度转换程序. 代码如下: t=input("请输入带符号的温度值(如:32C):") if t[-1] in ["C", ...

  2. Python:基础知识(一)

    输入 input():接收命令行下输入 1)在py2下:如果你输的是一串文字,要用引号''或者""引起来,如果是数字则不用. 2)在py3下:相当于py2的raw_input(), ...

  3. Python:如何排序(sort)

    一.前言 对Python的列表(list)有两个用于排序的方法: 一个是内建方法list.sort(),可以直接改变列表的内容: >>> list1 = [9,8,7,6,5] &g ...

  4. Python:pyglet学习(2)图形的旋转&batch

    这次讲讲图形的旋转和批量渲染(rotate.batch) 1:图形旋转 先看看上次的代码中的一段: glRotatef(rot_y, 0, 1, 0) glRotatef(rot_z,0,0,1) g ...

  5. Python:pyglet学习(1):想弄点3D,还发现了pyglet

    某一天,我突然喜欢上了3D,在一些scratch教程中见过一些3D引擎,找了一个简单的,结果z轴太大了,于是网上一搜,就发现了pyglet 还是先讲如何启动一个窗口 先看看官网: Creating a ...

  6. Python:基础知识(二)

    常用模块 urllib2 :用于发送网络请求,获取数据 (Pyhton2中的urllib2工具包,在Python3中分拆成了urllib.request和urllib.error两个包.) json: ...

  7. python: 基本知识(一)

    从今天开始继续python的学习,将应用到到黑客学习中,一边学习黑客知识一边学习python. 1.类:(封装) class T: def  __init__(self,...): //类对象创建后调 ...

  8. Python:itertools模块(转)

    原文:http://www.cnblogs.com/cython/articles/2169009.html itertools模块包含很多创建迭代器的函数,可以用各种方式对数据进行循环操作,此模块中 ...

  9. Python:常用正则表达式(一)

    文章转载于:http://www.cnblogs.com/Akeke/(博主:Akeke) https://www.cnblogs.com/Akeke/p/6649589.html (基于JavaSc ...

随机推荐

  1. org.hibernate.hql.ast.QuerySyntaxException: XXX is not mapped

    因为 String sql2 = "select s from Student s where s.clazz.name=:name"; 此处的 Student 应该为类名.hql ...

  2. 谷歌浏览器安装adblock广告屏蔽插件

    访问不到google的应用商店的话,就从网上直接查找adblock for chrome.打开浏览器的开发者模式,下载解压后直接拖拽到浏览器即可.下载地址http://www.cr173.com/so ...

  3. jquery ui bootstrap日期插件

    http://blog.csdn.net/php_897721669/article/details/7404527 搜索“jquery ui日期插件怎么显示年份”? $("#datepic ...

  4. 根据backup-my.cnf来生成新的事务日志文件

    使用rpm包安装xtrabackup ## 安装依赖包yum -y install perl perl-devel libaio libaio-devel perl-Time-HiRes perl-D ...

  5. java 关于hashcode和equals的测试

    package thinkingInJava; import java.util.HashMap; /* * 测试在向以hashcode为基础的集合(HashSet , HashMap , HashT ...

  6. php课程---数组

    数组:    一:定义 1.赋值定义    $arr[0] = 5;    $arr[1] = "aa";        print_r ($arr); 2.定义索引数组    $ ...

  7. 影响 PHP 行为的扩展和网络函数

    <?php /* * * 影响 PHP 行为的扩展 * PHP 选项和信息 * * assert_options — 设置/获取断言的各种标志 assert — 检查一个断言是否为 FALSE ...

  8. 一键发布ASP.NET Web安装程序

    转载自:http://www.cnblogs.com/nangong/p/Web.html        前言:最近公司有个Web要发布,但是以前都是由实施到甲方去发布,配置,这几天有点闲,同事让我搞 ...

  9. mysql root 维护

    修改root密码: mysql -uroot -paaamysql> use mysql;mysql> UPDATE user SET password=password("aa ...

  10. java取整和java四舍五入方法 BigDecimal.setScale()方法详解

    import java.math.BigDecimal; public class TestGetInt { public static void main(String[] args) { doub ...