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. 好看的css3按钮和文本框

    .button{ width: 80px; line-height: 25px; text-align: center; ; color: #fff; text-shadow:1px 1px 1px ...

  2. Xtrabackup2.3.4安装

    安装过程种有很多报错,这里我就不一一解释. wget https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.3.5/bin ...

  3. cocos2d-x-3.1.1 创建项目

    cocos new 项目名  -p 包名 -l  语言 -d 路径 cmd 输入以下命令 cocos new HelloLua -p com.wcc.hellolua -l lua -d E:\coc ...

  4. java中类的继承

    我们都知道java的四大特性:抽象.继承.封装.多态: 那么关于继承有哪些特性呢?下面看具体实例: (1) public class Person { public  int a=2; public  ...

  5. 使用smtp和pop3 协议收发qq邮箱实验

    email系统组件:MTA 消息传输代理,负责邮件的路由,队列和发送SMTP 简单邮件传输协议1 连接到服务器2 登陆3 发出服务请求4 退出POP:邮局协议RFC918 "邮局协议的目的是 ...

  6. Handler的总结

    Handler的总结 我们创建的Service.Activity,Broadcast均是一个主线程处理,即UI线程, 但是进行耗时操作时,比如I/O读写的大文件,数据库操作及网络下载需要很长的时间,为 ...

  7. 增强for循环

    import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.Li ...

  8. 使用 Sublime Text3 编辑 Markdown

    安装插件 可以通过安装 Markdown 的插件来使 Sublime Text3 变成一款 Markdown 编辑器 1.Markdown Preview 插件 输入Shift + Ctrl + P, ...

  9. TreeView Class Key Points

    TreeView keep selected node highlighted public QualityCheck() { InitializeComponent(); //trvIndexNam ...

  10. VMware网络设置

    Host-only:主机想和虚拟机通信时使用 NAT :虚拟机想通过主机IP上网时使用 Bridged:虚拟机直接连接到物理网络时使用 Q:如果主机想和虚拟机正常通信又想能上网怎么办? A:添加两个网 ...