<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body> <div style="border: 1px solid red;width: 500px;height: 280px;margin: 0 auto;position: relative">
<div style="background-color: black;width: 40px;height: 40px;position: absolute;right: 0;bottom: 0;color: white">
<div style="line-height: 40px; text-align: center">哈哈</div>
</div> </div>
<div style="border: 1px solid red;width: 500px;height: 280px;margin: 0 auto;position: relative">
<div style="background-color: black;width: 40px;height: 40px;position: absolute;left: 0;top: 0;color: white">
<div style="line-height: 40px; text-align: center">哈哈</div>
</div> </div> </body>
</html>

效果如下图

position的 relative+absolute实现固定标签在窗口的某个位置的更多相关文章

  1. css属性position: static|relative|absolute|fixed|sticky简单解析

    目录 static 静态定位(默认) relative 相对定位 正常文档流 加了relative之后的布局 加上margin/padding/border之后的布局 absolute 绝对定位 正常 ...

  2. CSS 浅析position:relative/absolute定位方式

    ## 一.position:relative 相对定位 ## 分两种情况分析: · 无 position: relative: · 有 position: relative. 代码如下图: 显示效果如 ...

  3. What is the difference between position: static,relative,absolute,fixed

    What is the difference between static,relative, absolute,fixed we can refer to this link: expand

  4. 【前段开发】10步掌握CSS定位: position static relative absolute float

    希望能帮到须要的人,转自:http://www.see-design.com.tw/i/css_position.html 1. position:static 元素的 position 屬性默認值為 ...

  5. HTML中三种定位relative,absolute,fixed后,盒子的百分比宽度及位置易错点

    1 . 相对定位relative:顾名思义,相对定位是相对于自己的位置来进行偏移,如下图: 以盒子中心为基准,为每条边的正方向,例: 向右移动20px : 代码为left:20px;或者right:- ...

  6. CSS position relative absolute fixed

    position属性absolute与relative 详解   最近一直在研究javascript脚本,熟悉DOM中CSS样式的各种定位属性,以前对这个属性不太了解,从网上找到两篇文章感觉讲得很透彻 ...

  7. (转)Position定位:relative | absolute

    原文:http://hi.baidu.com/zxc0420/item/9ada5110845ba1e89c778a08 Position定位:relative | absolute 定位一直是WEB ...

  8. 2016/2/19 position: fixed absolute relative z-index float 半透明效果

    一.position:fixed 锁定位置(相对于浏览器的位置),例如有些网站的右下角的弹出窗口.      显示效果  无论滚动条怎么移动  都固定在显示页面的一个位置不动 二.position:a ...

  9. CSS里面position:relative与position:absolute 区别

    position:absolute这个是绝对定位:是相对于浏览器的定位.比如:position:absolute:left:20px;top:80px; 这个容器始终位于距离浏览器左20px,距离浏览 ...

随机推荐

  1. sweetAlert()参数配置

    alertTypes = ['error', 'warning', 'info', 'success'], defaultParams = { title: '', text: '', type: n ...

  2. Java中23种设计模式--超快速入门及举例代码

    在网上看了一些设计模式的文章后,感觉还是印象不太深刻,决定好好记录记录. 原文地址:http://blog.csdn.net/doymm2008/article/details/13288067 注: ...

  3. Microsoft JDBC Driver 使用 getParameterMetaData 会报错?

    不知道为何使用 Microsoft JDBC Driver for SQL Server 驱动时,sql语句不带参数没有问题,但是如果带参数且使用 getParameterMetaData 就会提示某 ...

  4. Murano Weekly Meeting 2015.07.21

    会议时间: 2015.07.21 主持人: Kirill Zaitsev, core from Mirantis 会议摘要:  1.murano client和murano dashboard升级到y ...

  5. python 多继承(新式类) 四

    转载自:http://blog.sina.com.cn/s/blog_45ac0d0a01018488.html mro即method resolution order,主要用于在多继承时判断调的属性 ...

  6. JDK11 | 第七篇 : ZGC 垃圾收集器

    一.简介 Java 11包含一个全新的垃圾收集器--ZGC,它由Oracle开发,承诺在数TB的堆上具有非常低的暂停时间. 在本文中,我们将介绍开发新GC的动机,技术概述以及由ZGC开启的一些可能性. ...

  7. Golang: runnerw.exe: CreateProcess failed with error 216 (no message available)

    话说这个我应该遇到几次了 每次新项目都有这问题,我的记忆是金鱼的记忆吗? 好在这次隐约记起是包名的问题... 方法 修改包名为main

  8. U盘安装Ubuntu15.04 出现boot failed: please change disks and press a key to continue

    1.根据国内的教程,用Ultraiso制作了一个Ubuntu15.04的U盘启动盘,在装系统的时候提示如下错误:boot failed: please change disks and press a ...

  9. P1681 最大正方形 Iand II

    题目描述 在一个n*m的只包含0和1的矩阵里找出一个不包含0的最大正方形,输出边长. 输入输出格式 输入格式: 输入文件第一行为两个整数n,m(1<=n,m<=100),接下来n行,每行m ...

  10. HTML 5 Web 存储提供了几种存储数据的方法

    localstorage存储对象分为两种: 1. sessionStorage: session即会话的意思,在这里的session是指用户浏览某个网站时,从进入网站到关闭网站这个时间段,sessio ...