css-position

Keep div:hover open when changing nested select box

爷,独闯天下 提交于 2019-11-28 12:46:56
This is an IE-only problem. You can see the problem here (dead link) with IE (wait for the page to load, and hover the NY Times icon in the bottom left toolbar. Then try to select a new option). The Layout: .toolTip becomes visible when it's parent div is hovered over. Inside of .toolTip is a select box. When the user opens the select box to make a selection, the parent element gets hidden. Why is IE thinking that when I hover over the Select box, I am not over the parent div anymore? Here is some relevant code (pared down for clarity): #toolBar .toolTip { position: absolute; display:none;

How to horizontally center a fixed positioned element

独自空忆成欢 提交于 2019-11-28 12:43:34
I have a layer with an image inside: <div id="foo"><img src="url" /></div> and it is fixed positioned: #foo { position: fixed; } but I also want the layer to be horizontally centered in the page. So I've tried: http://jsfiddle.net/2BG9X/ #foo { position: fixed; margin: auto } and http://jsfiddle.net/2BG9X/1/ #foo { position: fixed; left: auto; } but doesn't work. Any idea of how to achieve it? When you position an element to fixed , it gets out of the document flow, where even margin: auto; won't work, if you want, nest an element inside that fixed positioned element and than use margin: auto;

Positioning context on table-cell element in Firefox

北城余情 提交于 2019-11-28 11:39:31
问题 Usually, we can set a parent element to be the context for a child's absolute positioning, as follows: #parent { position: relative; } #child { position: absolute; top: 0; left: 0; } This all works fine, but when the parent has its display property set to table-cell , it doesn't work in Firefox. The positioning context for the child element will be the closest positioned ancestor above its parent. Of note, this works everywhere else. Tested in IE8, IE9, Safari, Chrome & Opera. See the fiddle

Why doesn't Z-Index in IE render the way it's supposed to over a Flash Movie?

狂风中的少年 提交于 2019-11-28 11:25:56
I am working on a site with two absolutely positioned divs... the logo and the menu (navbar) IE is burying them both, even after multiple tries of z-index manipulation. Why can't IE work as well as Firefox or even Opera for God's sake? UPDATE....... I forgot to mention that these divs are positioned over a flash movie. How could I possibly have left that out?! If your flash movie is burying your other content you may have luck by adding an additional param element to your embedded object: <param name="wmode" value="opaque" /> For a longer answer you can see this blog post about stacking

How to position child div to the center of every parents div using position absolute in css [duplicate]

我只是一个虾纸丫 提交于 2019-11-28 10:37:55
问题 This question already has an answer here: How to center absolutely positioned element in div? 33 answers I'm having difficulty on positioning child div's on every parents div. Here's the css code: .mainDiv { height:500px; position: relative; } .mainDiv .parent1 { height: 250px; background-color: blue; top: 50px; position: relative; } .mainDiv .parent2 { height: 250px; background-color: yellow; position: relative; } .mainDiv .parent1 .sub1 { width: 100px; height: 100px; background-color: green

CSS - Making a div consume all available space

落爺英雄遲暮 提交于 2019-11-28 09:52:57
All, I have a page which is suppose to take up only the available screen space in the browser. I have a 'top bar' and a 'bottom bar', both of which are fixed positioned at the top and bottom of the page. I want to have a div which will consume (take up) the remaining of the space inbetween the two bars mentioned above. Its crucial that the middle div is not overlapped by the top and bottom bars. Is this at all possible with CSS or do I need to make use of js. Also, if I do go with js, considering the browser loads up the CSS first before the js code, how is the above work out using js for

Why isn't my margin working with position: fixed?

丶灬走出姿态 提交于 2019-11-28 09:18:48
JSFiddle Demo I have a div for a header and a div for a content wrap. For some reason, I can't have a margin on the bottom of the header that forces the content wrap to push down. It just ignores it completely and I have no idea why. Does anyone know what is going on with this? It doesn't do this when I take away the position: fixed; attribute on the header, but I want it to be fixed at the top so when scrolling the header is always in view. Hoping someone can explain why this happens or at least what it is called so I can google it. body { margin: 0; padding: 0; font-family: arial; background

How can I make a menubar fixed on the top while scrolling

半腔热情 提交于 2019-11-28 09:13:33
I'd like to make a menubar, which is fixed on the top of the page while scrolling. Something like the top menu in Facebook. Also, I want a div holding the logo float at the left of menubar, and a nav float at the right of the menubar. This should get you started <div class="menuBar"> <img class="logo" src="logo.jpg"/> <div class="nav"> <ul> <li>Menu1</li> <li>Menu 2</li> <li>Menu 3</li> </ul> </div> </div> body{ margin-top:50px;} .menuBar{ width:100%; height:50px; display:block; position:absolute; top:0; left:0; } .logo{ float:left; } .nav{ float:right; margin-right:10px;} .nav ul li{ list

How to enable user-scalable (viewport property) after disabling it?

旧时模样 提交于 2019-11-28 08:51:05
问题 I created an Android app with Phonegap. I want to be able to have a fixed div in one page and to zoom-in in another page. I use jquery mobile 1.2.0, Jquery 1.8.2, Phonegap 2.0.0 and Android 2.2. My code is: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>My Phonegap Application</title> <link rel="stylesheet" href="./lib/jquery.mobile-1.2.0.css" /> <script src="./lib/jquery-1.8.2.js"></script> <script src="./lib/jquery.mobile-1.2.0.js"></script> <script src="./lib/cordova-2.0.0.js"

Mobile web: -webkit-overflow-scrolling: touch conflicts with position:fixed

六月ゝ 毕业季﹏ 提交于 2019-11-28 07:19:03
问题 I use position: fixed to create a fixed top navigation menu on my mobile web application. After adding -webkit-overflow-scrolling: touch , the scrolling works smoothly. However, the top menu disappears during scrolling. It shows only after the scrolling stops. I have searched many solutions, such as CSS3 property webkit-overflow-scrolling:touch ERROR and iOS5 Images disappear when scrolling with webkit-overflow-scrolling: touch. However, the given solutions are not working for me. Please