position

z-index神奇的失效了!!!

北慕城南 提交于 2019-12-02 21:47:38
z-index失效的原因 情况一: z-index无论设置多高都不起作用情况 【可能原因】 父元素的position属性为relative 问题标签无position属性(除了static) 问题标签设置了浮动(float)属性 问题标签的祖先标签的z-index值比较小(IE6和IE7有时候不是看子标签的z-index有多高,而要看整个DOM tree(节点树)的第一个(最外层)relative属性的父标签的层级) 注:浮动会让z-index失效 【解决方法】 将父元素的position:relative改为position:absolute,或者直接删除父元素的position属性 给问题标签设置position属性(relative、absolute、fixed) 清除浮动 提高父标签的z-index值 来源: https://www.cnblogs.com/kunmomo/p/11763720.html

animate.css

我与影子孤独终老i 提交于 2019-12-02 21:43:13
下载插件 ( 11) 简要教程 这是一款基于 animate.css 的效果非常酷的CSS消息提示动画效果。这66种CSS消息提示动画效果按出现位置分为4种类型:上部、中部、中下和右下。每个部位的消息提示效果都是不一样的。 注意:这个CSS消息提示动画效果需要在支持 CSS3 的浏览器中才能正常工作。 HTML结构 该CSS消息提示动画效果的HTML结构非常简单。使用一个id为 #notifications 的 div 作为整个包裹容器。 < div id = "notifications" ></ div > 消息提示框的代码默认情况下是不存在与DOM中的,它们使用js来动态插入。例如当选择"Top"选项时,在点击触发按钮后,Top消息提示框将使用js插入到DOM中: < div id = "notifications-top-center" > < span class = "iconb" data-icon = "" ></ span > Oups something went wrong ! < div id = "notifications-top-center-close" class = "close" > < span class = "iconb" data-icon = "" ></ span > </ div > </ div > 对于中部

RecyclerView的应用及RecyclerView的点击事件

时间秒杀一切 提交于 2019-12-02 21:33:57
第一步:导入依赖包 implementation 'com.android.support:recyclerview-v7:25.3.1' 第二步:用 JSONArray 解析后台数据并setadapter JSONArray jsonArray = jsonObject.getJSONArray("obj"); if (jsonArray.size() > 0) { for (int i = 0; i < jsonArray.size(); i++) { JSONObject jb = jsonArray.getJSONObject(i); patientID = jb.getInteger("id"); patientName = jb.getString("name"); patientPhone = jb.getString("phone"); patientSFZNum = jb.getString("identityno"); PatientPhoneBean patientPhoneBean = new PatientPhoneBean(); patientPhoneBean.setPatientID(patientID); patientPhoneBean.setPatientName(patientName); patientPhoneBean

CSS - div aligning to the bottom of parent div (inline-block)

瘦欲@ 提交于 2019-12-02 21:06:46
问题 I know this html is sloppy, with some extra divs that are unnecessary, but regardless, I can't understand why the div with ID "info_box_right" is aligning to the bottom of the parent div (you can see the "text" aligned to the bottom at the below jsfiddle example). Any ideas how I can get it to align to the top of its parent? http://jsfiddle.net/taddme0y/1/ HTML: <div id="info_container" > <div id="info_box"> <hr class="info_box_hr" noshade> <a id="info_box_title"></a> <hr class="info_box_hr"

CSS 基础总结

匿名 (未验证) 提交于 2019-12-02 20:32:16
1 介绍一下标准的CSS的盒子模型?与低版本IE的盒子模型有什么不同的? 标准盒子模型:宽度=内容的宽度(content)+ border + padding + margin 低版本IE盒子模型:宽度=内容宽度(content+border+padding)+ margin 2 box-sizing属性? 用来控制元素的盒子模型的解析模式,默认为content-box context-box:W3C的标准盒子模型,设置元素的 height/width 属性指的是content部分的高/宽 border-box:IE传统盒子模型。设置元素的height/width属性指的是border + padding + content部分的高/宽 3 CSS选择器有哪些?哪些属性可以继承? CSS选择符:id选择器(#myid)、类选择器(.myclassname)、标签选择器(div, h1, p)、相邻选择器(h1 + p)、子选择器(ul > li)、后代选择器(li a)、通配符选择器(*)、属性选择器(a[rel=”external”])、伪类选择器(a:hover, li:nth-child) 可继承的属性:font-size, font-family, color 不可继承的样式:border, padding, margin, width, height 优先级(就近原则):

web前端布局HTML+CSS

匿名 (未验证) 提交于 2019-12-02 20:32:16
1、W3C标准 http://www.w3school.com.cn/      规范是一种态度   2、页面布局   2.1 布局元素    position定位: absolute 生成绝对定位的元素,相对于 static 定位以外的第一个父元素进行定位。元素的位置通过 "left", "top", "right" 以及 "bottom" 属性进行规定。 fixed 生成绝对定位的元素,相对于浏览器窗口进行定位。元素的位置通过 "left", "top", "right" 以及 "bottom" 属性进行规定。 relative 生成相对定位的元素,相对于其正常位置进行定位。因此,"left:20" 会向元素的 LEFT 位置添加 20 像素。 static 默认值。没有定位,元素出现在正常的流中(忽略 top, bottom, left, right 或者 z-index 声明)。 inherit 规定应该从父元素继承 position 属性的值。   display属性: none 此元素不会被显示。 block 此元素将显示为块级元素,此元素前后会带有换行符。 inline 默认。此元素会被显示为内联元素,元素前后没有换行符。 inline-block 行内块元素。(CSS2.1 新增的值) list-item 此元素会作为列表显示。 table

用css画一个哆啦A梦

匿名 (未验证) 提交于 2019-12-02 20:32:16
原图: 效果图: 虽然说没用啥什么高级的技巧,但这让我感受到了CSS的乐趣! 好好学习,天天向上! <!DOCTYPE html> <html> <head> <title></title> <style type="text/css"> body{ background-color: #66B3FF; height: 300px; overflow: hidden; } #head{ width: 200px; height: 200px; position: absolute; left: 50%; top:31%; margin-left: -100px; margin-top: -100px; background-color: #0080FF; border-radius: 999px; border: 1px solid black; } #face{ width: 179px; height: 150px; position: absolute; left: 43.4%; top:22%; background-color: white; border-radius: 999px; border: 1px solid black; } #leftEye{ width: 50px; height: 60px; position: absolute; left:46.2%

HTML之Position用法

匿名 (未验证) 提交于 2019-12-02 20:32:16
position的四个属性值: 1.relative 2.absolute 3.fixed 4.static 下面分别讲述这四个属性。 <div id="parent"> </div> 1. relative relative属性相对比较简单,我们要搞清它是相对哪个对象来进行偏移的。答案是它本身的位置。在上面的代码中,sub1和sub2是同级关系,如果设定sub1一个relative属性,比如设置如下CSS代码: #sub1 { } 我们可以这样理解,如果不设置relative属性,sub1的位置按照正常的文档流,它应该处于某个位置。但当设置sub1为的position为relative后,将根据top,right,bottom,left的值按照它理应所在的位置进行偏移,relative的“相对的”意思也正体现于此。 对于此,您只需要记住,sub1如果不设置relative时它应该在哪里,一旦设置后就按照它理应在的位置进行偏移。 随后的问题是,sub2的位置又在哪里呢?答案是它原来在哪里,现在就在哪里,它的位置不会因为sub1增加了position的属性而发生改变。 如果此时把sub2的position也设置为relative,会发生什么现象?此时依然和sub1一样,按照它原来应有的位置进行偏移。 注意relative的偏移是基于对象的margin的左上侧的。 2.

HTML float 和 absolute

匿名 (未验证) 提交于 2019-12-02 20:32:16
block元素和inline元素在文档流中的排列方式: block元素通常被现实为独立的一块,独占一行,多个block元素会各自新起一行,默认block元素宽度自动填满其父元素宽度。block元素可以设置width、height、margin、padding属性; inline元素不会独占一行,多个相邻的行内元素会排列在同一行里,直到一行排列不下,才会新换一行,其宽度随元素的内容而变化。inline元素设置width、height属性无效。 inline元素的margin和padding属性: 水平方向的padding-left, padding-right, margin-left, margin-right都产生边距效果;但竖直方向的padding-top, padding-bottom, margin-top, margin-bottom不会产生边距效果。 文档流 : 指的是元素排版布局过程中,元素会自动从左往右,从上往下的流式排列。 脱离文档流 : 将元素从普通的布局排版中拿走,其他盒子在定位的时候,会当做脱离文档流的元素不存在而进行定位。只有绝对定位absolute和浮动float才会脱离文档流。 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title>

How do I automatically stack divs vertically inside a parent?

。_饼干妹妹 提交于 2019-12-02 20:26:38
Here's what I am trying to accomplish... "parent" has position:relative "div 1-3" have position:absolute However, whenever I do this, I find myself having to assign specific "top" values in my CSS. So div 1 might be top:50px, div 2 would be top:150px, and div 3 would be top:225px; Is there a way to make sure the divs continue to stack inside the parent without assigning top values and/or absolute positioning? Joseph A div should already display as a block and take up a full "row". Here is some HTML and CSS to give an example, compare it to your code: http://jsfiddle.net/mWcWV/ <div id="parent"