position

简单的CSS3 Loading动画

Deadly 提交于 2020-01-05 02:34:56
  最终效果如图一,gif图片稍微有点卡顿,事实上代码在浏览器里执行得很流畅。这里面用到的css3技术非常简单,分别是border-radius、伪元素、css3关键帧以及animation动画。   首先整理一下大概的思路:整个圆分为AB两部分,左右都是半圆,上面盖了一个背景色为白色的小圆,如右图,简单布局如下:    <style> .loading{margin:100px auto; width: 8em; height: 8em; position: relative;} .loading .progress{position: absolute; width: 6em; height:6em; background-color: white; border-radius: 50%; left: 1em; top: 1em; line-height: 6em; text-align: center; } .left,.right{width: 4em;height: 8em;overflow: hidden; position: relative; float: left;} .left{ border-radius: 8em 0 0 8em;} .right{ border-radius: 0 8em 8em 0;} .left:after,.right:after

web前端入门到实战:css绝对定位和相对定位、固定定位

ⅰ亾dé卋堺 提交于 2020-01-04 19:29:22
1、绝对定位 position:absolute; 绝对定位指的是通过规定HTML元素在水平和垂直方向上的位置来固定元素,基于绝对定位的元素不会占据空间。绝对定位的位置声明是相对于已定位的并且包含关系最近的祖先元素。如果当前需要被定为的元素没有已定位的祖先元素作为参考值,则相对于整个网页。 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>定位和布局</title> </head> <style> .big { width: 900px; height: 600px; background-color: black; position: relative; } .box4 { width: 150px; height: 100px; background-color: blue; position: absolute; top: 150px; left: 200px; } </style> <body> <div class="big"> <div

python将pdf文档转为png图片

独自空忆成欢 提交于 2020-01-04 15:53:54
python -V 3 需求 五个pdf文档需要都转成png格式图片 代码 可以使用PyMuPDF库 逻辑: 1、首先读取一个文件夹下面的所有pdf文档 2、然后对这些pdf文档一个一个的进行pdf转png,一页pdf转为一个png图片,一个pdf文档转成的所有png图片存在一个文件夹下面 import fitz import os def f ( position ) : name = os . listdir ( './%s' % position ) for n in name : # 打开PDF文件,生成一个对象 path = r './pdfs/%s' % n doc = fitz . open ( path ) for pg in range ( doc . pageCount ) : page = doc [ pg ] rotate = int ( 0 ) # 每个尺寸的缩放系数为2,这将为我们生成分辨率提高四倍的图像。 zoom_x = 2 zoom_y = 2 trans = fitz . Matrix ( zoom_x , zoom_y ) . preRotate ( rotate ) pm = page . getPixmap ( matrix = trans , alpha = False ) dir_1 = './pngs/%s/' % n [ : - 3

Position absolute not working inside position fixed

六月ゝ 毕业季﹏ 提交于 2020-01-04 07:47:50
问题 <div id="main" style="position: fixed"> <div id="inner" style="position: absolute"> </div> </div> Both main and inner containers taking position: fixed . How to make inner container with position:absolute and main container with position:fixed ? 回答1: You need to define top , right , bottom or left properties when using fixed , relative or absolute positioning on an element. #main { background: #000; position: fixed; height: 300px; width: 200px; left: 20px; top: 10px; } #inner { background:

Affix div to bottom of window

南楼画角 提交于 2020-01-04 06:51:50
问题 I was wondering how I can fix a div to the bottom of the window as it scrolls out of view. I know you can do it with twitter bootstrap but I don't want to use a library. So far I have some jQuery that I thought would work: $(window).scroll(function() { if (((($('.show_postQuestion').offset().top + $('.show_postQuestion').height()) - ($(window).scrollTop()+$(window).height())) > 0)) { // Post form off-screen $('.show_postQuestion').addClass('fixed'); } else { $('.show_postQuestion')

RecyclerView长按删除

喜欢而已 提交于 2020-01-04 03:02:53
Adapter中添加 public interface LongClickLisenter { void LongClickLisenter(int position); } private LongClickLisenter longClickLisenter; public void setLongClickLisenter(LongClickLisenter longClickLisenter) { this.longClickLisenter = longClickLisenter; } public void del(int i) { result.remove(i); notifyDataSetChanged(); } 适配器onCreateViewHolder中添加 view.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { int layoutPosition = myViewHandler.getLayoutPosition(); if (longClickLisenter != null) { longClickLisenter.LongClickLisenter(layoutPosition); }

转发- css(display,float,position)

大憨熊 提交于 2020-01-03 19:27:03
此文章仅为转发,非原创, 原文 http://www.cnblogs.com/zhuanggege/p/5778309.html 请支持原创 display 用来设置元素的显示方式 display : block | none | inline | inline-block inline:指定对象为内联元素 block:指定对象为块元素 inline-block:指定对象为内联块元素 none:隐藏对象 float 控制元素是否浮动显示 float : none | left | right none:设置对象不浮动 left:设置对象浮在左边 right:设置对象浮在右边 浮动的目的: 就是要打破文档流的默认显示规则。如果要让元素按照我们的布局要求进行显示。这时就要利用float属性 任何申明为 float 的元素自动被设置为一个“块级元素” 在标准浏览器中浮动元素脱离了文档流 ,所以浮动元素后的元素会占据浮动元素本来应该所处的位置 如果水平方向上没有足够的空间容纳浮动元素,则转向下一行 文字内容会围绕在浮动元素周围 浮动元素只能浮动至左侧或者右侧 clear 清除浮动 clear : none | left | right | both none:默认值。允许两边都可以有浮动对象 left:不允许左边有浮动对象 right:不允许右边有浮动对象 both:不允许有浮动对象

CSS中的三种基本的定位机制

我只是一个虾纸丫 提交于 2020-01-03 19:17:23
CSS 定位机制 CSS 有三种基本的定位机制:普通流、浮动和绝对定位。 一、普通流   除非专门指定,否则所有框都在普通流中定位。普通流中元素框的位置由元素在(X)HTML中的位置决定。块级元素从上到下依次排列,框之间的垂直距离由框的垂直margin计算得到。行内元素在一行中水平布置。 二、定位    1、相对定位   被看作普通流定位模型的一部分,定位元素的位置相对于它在普通流中的位置进行移动。使用相对定位的元素不管它是否进行移动,元素仍要占据它原来的位置。移动元素会导致它覆盖其他的框。 <html> <head> <style type="text/css"> .box1{ background-color: red; width:100px; height:100px; } .box2{ background-color: yellow; width:100px; height:100px; position: relative; left: 20px; } .box3{ background-color: blue; width:100px; height:100px; position: relative; right: 20px; } </style> </head> <body> <div class="box1">box1</div> <div class=

7、文档流相关

大城市里の小女人 提交于 2020-01-03 19:04:04
一、什么是文档流 文档流是文档中可显示对象在排列时所占用的位置。换句话讲就是将窗体自上而下分成一行行, 并在每行中按从左至右的顺序排放元素,即为文档流.(自己的理解是从头到尾按照文档的顺序,该在什么位置就在什么位置,也可以按照上面的意思理解,自上而下,自左到右的顺序) 二、文档流代码 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style> body{ margin: 0; padding: 0; } div{ width: 100px; background: pink; height: 100px; border: 1px solid #000000; } </style> </head> <body> <div>01</div> <div>02</div> <div>03</div> </body> </html> 代码段运行结果 上图就是标准的文档流,按照顺序自行排列。该在什么位置就在什么位置。 三、脱离文档流的方法: 目前脱离文档流有两种方法:1、float;2、定位也就是postion。 四、float float 属性定义元素在哪个方向浮动。以前这个属性总应用于图像,使文本围绕在图像周围,在 CSS 中任何元素都可以浮动。浮动元素会生成一个块级框,而不论它本身是何种元素

元素层叠总结

守給你的承諾、 提交于 2020-01-03 18:59:08
重点:在相同的层叠环境及优先级下,inline/inline-block元素的层叠顺序高于block元素。 详解链接: https://www.codercto.com/a/23706.html 本文转载自:https://juejin.im/post/5b876f86518825431079ddd6,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有。 最近,在项目中遇到一个关于CSS中元素 z-index 属性的问题,具体问题不太好描述,总结起来就是当给元素和父元素色设置 position 属性和 z-index 相关属性后,页面上渲染的元素层级结果和我预想的不一样。根据自己之前的理解,也没找到一个合理的解释。我知道,肯定是我对相关属性的细节理解存在问题,所以结合官方文档和在网上各种搜集整理,明白了其中的原因。写下这篇文章,和大家分享有关CSS中 层叠上下文 、 层叠等级 、 层叠顺序 以及 z-index 相关的一整套技术细节。 如果存在什么错误或重要遗漏或者有什么疑问,欢迎留言指正、讨论!感谢! 本文已同步至我的个人主页。更多内容,欢迎访问我的GitHub主页,谢谢关注和支持! 一个“片面”的理解 以往,由于自己使用 z-index 的频率不大,所以对这个CSS属性存在比较片面的认识。一直认为 z-index 就是用来描述定义一个元素在屏幕 Y轴 上的堆叠顺序。