absolute

h5-360_introduce页面案例

本秂侑毒 提交于 2019-11-28 09:51:08
整个网页的html 首先,忽略我的网页比较丑,主要是ps功底不太好, 其次这个网页是利用了全屏插件:jquery.fullPage.js。需要事先导入相应的js文件 js文件下载地址:http://www.dowebok.com/77.html js文件网页中有使用教程和一些小案例 整个案例运用了交集选择器 1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Title</title> 6 <link href="../css/360.css" rel="stylesheet"> 7 <link rel="stylesheet" href="../css/jquery.fullPage.css"> 8 <script src="../js/jquery-1.8.3.min.js"></script> 9 <script src="../js/jquery.fullPage.js"></script> 10 <script src="../js/jquery.fullPage.min.js"></script> 11 <style> 12 13 </style> 14 </head> 15 <body> 16 <div id="360Page"> 17 <div class=

jQueryUI slider: absolutely positioned element & parent container height

♀尐吖头ヾ 提交于 2019-11-28 09:03:06
I have an example on http://jsfiddle.net/SsYwH/ In case it don't work HTML: <div class="container"> <div class="absolute"> Testing absolute<br /> Even more testing absolute<br /> </div> A little test<br /> </div> CSS: .container { background: green; } .absolute { position: absolute; background: red; } Problem I use jQuery to create a slider-effect. To do that I need to set position absolute. The red block in my code is the position absolute slider. The green block is the container. I still want the container to be set by it's childs height. Now it don't know it because of the position absolute

Set height 100% on absolute div

纵饮孤独 提交于 2019-11-28 07:10:36
I am facing a problem with overlaying a 100% height div . I could use position fixed to solve the cover, but that's not really what I want because you should be able to scroll down on the 'cover' > so people with lower resolutions than mine can see the entire content. Code example: HTML <body> <div>Overlay example text</div> </body> CSS body { float: left; height: 3000px; width: 100%; } body div { position: absolute; height: 100%; width: 100%; background-color: yellow; } The problem: The div's height 100% only contains 100% of the webbrowser/viewport, but I want it to cover the entire body.

css布局之居中

时光毁灭记忆、已成空白 提交于 2019-11-28 07:05:40
CSS布局之居中 本文主要是介绍水平居中,垂直居中,还有水平垂直居中的方法 水平居中 1. 行内元素水平居中 使用text-align:center;就可以实现行内元素的水平居中,但是记得要在父元素中设置,会对子元素生效。此方法对, inline、inline-block、inline-table、inline-flex 都有效。 .box{ text-align:center; } 此外,如果块级元素包着一个块级元素,那么我们可以设置外部盒子text-align:center;给内部盒子设置display:inline-block;这样也可以使得内部元素居中。但要注意的是,内部盒子已经设置了display:inline-block,就不可以再设置其他的display,所以最好不要使用这种方法。 <div class="parent"> <div class="child"> </div> </div> <style> .parent{ text-align:center; } .child{ display:inline-block } </style> 2. 块级元素水平居中 使用margin居中 margin:0 auto;但是使用这种方法,要记得给元素设置宽度,否则不会生效 使用absolute+transform absolute 定位,左 50%,然后使用

css垂直居中方案

耗尽温柔 提交于 2019-11-28 01:22:54
垂直居中的几种方法 html结构 <div class="container"> <div class="item">垂直居中</div> </div> css <style> .container { width: 500px; height: 500px; border: 1px solid #000; position: relative; } </style> 1. 使用flex布局 在父容器中设置 .container{ displayy: flex; justify-content: center; align-items: center } 2. 绝对定位 分为已知宽高和未知宽高两种情况 已知宽高都是100px,设置自身为绝对定位(absolute),top和left为50%,margin-left、margin-top为自身的一半,也就是50px .item { width: 100px; height: 100px; border: 1px solid red; position: absolute; top: 50%; left: 50%; margin-left: -50px; margin-top: -50px; } 未知宽高 /*使用traansform*/ .item { border: 1px solid red; position: absolute

常见浏览器的兼容问题

若如初见. 提交于 2019-11-28 00:22:28
   初学html和css时,每天切图,总会遇到很多浏览器兼容性问题。最近一直关注移动平台开发,就html和css来说,不用考虑那么多浏览器兼容性问题。到现在,以至于很多浏览器兼容性几乎忘光了。今天把以前总结的知识拿来分享一下,顺便自己也复习一下。当然,其中肯定有很多不足,望指正啊。 1 ie6.0横向margin加倍 产生因素:块属性、float、有横向margin。 解决方法:display:inline; 2 ie6.0下默认有行高 解决方法:overflow:hidden;或font-size:0;或line-height:xx px; 3 在各个浏览器下img有空隙(原因是:回车。) 解决方法:让图片浮动。 4 一个父标签与几个子标签嵌套,父标签不浮动,子标签float,子标签不撑开父的高度。 解决方法:a 在子标签最后清浮动{<div style="height:0;clear:both;"> </div>} b 父标签添加{overflow:hidden;} c 给父标签设置高度 5 Ie6下,不识别最大宽、高度和最小宽高度,意即min-width/height和 Max-width/height在ie6中没效果, 解决方法:(1):.abc{border:1px blue solid;width:200px;height:200px;} html>body .abc

absolute position affects width?

我只是一个虾纸丫 提交于 2019-11-27 23:35:27
I am new to css. I am wondering why when I change the positioning of the div element to absolute, the width of the div element changes? Tried it out in Chrome v25.0.1364.172m and IE9, both have the same outcome. Simple example: <!doctype html/> <html> <head> <title>test</title> <style> div { position:relative; border-width: 1px; border-style: solid; border-color: black; } </style> </head> <body> <div>test</div> </body> </html> Because absolutely positioned elements do not behave as block level elements and do not flow after each other like normal a <div> does. You will need to set a width and

Text Wrapping around an absolute positioned div

◇◆丶佛笑我妖孽 提交于 2019-11-27 22:45:44
I know there are a few questions about similar topics but they mostly amount to floating the div/image. I need to have the image (and div) positioned absolutely (off to the right) but I simply want the text flow around it. It works if I float the div but then I can't position it where I want. As it is the text just flows behind the picture. <div class="post"> <div class="picture"> <a href="/user/1" title="View user profile."><img src="http://www.neatktp.com/sites/default/files/photos/BlankPortrait.jpg" alt="neatktp's picture" title="neatktp's picture" /></a></div> <span class='print-link'><

Getting URL of executing JavaScript file (IE6-7 problem mostly)

夙愿已清 提交于 2019-11-27 21:36:13
问题 Hey all, I've been trying to throw together a generic function that retrieves the absolute URL of an executing JavaScript file on a web page: http://gist.github.com/433486 Basically you get to call something like this: getScriptName(function(url) { console.log(url); // http://www.example.com/myExternalJsFile.js }); inside an external JavaScript file on a page and can then do something with it (like find the <script> tag that loaded it for example). It works great in almost all the browsers I

How to center div vertically inside of absolutely positioned parent div

我的未来我决定 提交于 2019-11-27 16:51:15
I am trying to get blue container in the middle of pink one, however seems vertical-align: middle; doesn't do the job in that case. <div style="display: block; position: absolute; left: 50px; top: 50px;"> <div style="text-align: left; position: absolute;height: 56px;vertical-align: middle;background-color: pink;"> <div style="background-color: lightblue;">test</div> </div> </div> Result: Expectation: Please suggest how can I achieve that. Jsfiddle Hashem Qolami First of all note that vertical-align is only applicable to table cells and inline-level elements. There are couple of ways to achieve