css-position

IFRAME and conflicting absolute positions

只愿长相守 提交于 2019-11-29 03:03:14
I would like to have an IFRAME dynamically sized using the following CSS: #myiframe { position: absolute; top: 0; bottom: 0; left: 0; right: 0; } However, no browser seems to support this. In good browsers I could wrap the IFRAME in a DIV with the quoted CSS style and set the height & width of the IFRAME to 100%. But this does not work in IE7. Short of using CSS expressions, has anyone managed to solve this? Update MatTheCat answered with a scenario that works if the IFRAME is located directly under the body and the body/html tags have height: 100% set. In my original question I did not state

Is there anything wrong with positioning all elements relatively?

╄→尐↘猪︶ㄣ 提交于 2019-11-29 02:31:35
Often I find myself attaching a class to an element just to give it position: relative; so that I can position it's children using position: absolute; Would there by anything wrong, or should I say, would anything break if I was to write: * { position: relative; } or perhaps the below example, as these are usually the only elements I require the relative positioning on: div, navbar, footer, section, aside, header, article { position: relative; } According to W3schools, all elements are position: static; by default which is positioned according to the normal flow of the page. "HTML elements are

css - parent's position is absolute and child's position is relative and vice versa

僤鯓⒐⒋嵵緔 提交于 2019-11-29 02:28:46
I have div which hosts another div. Ok, I get the case when the parent is position:relative and the child is position:absolute . I don't get what happens when parent's position is absolute and child's position is relative parent's position is absolute and child's position is absolute parent's position is relative and child's position is relative I use the JSbin example from Why does an absolute position element wrap based on its parent's right bound? but the question applies to positioning concept in general Read more about absolute, relative, and fixed position and how they differ here , but

Google Maps api v3 tools: visual distortions?

不想你离开。 提交于 2019-11-29 02:01:34
问题 I just noticed that the gMap view tools are displaying…rather unusually. Their regions still seem to be properly defined—I can interact with them just fine, it's just their appearance that looks messed up. I haven't applied any CSS to any of the map pieces, and the only css I've applied to the map container is width:100%; height:100%; z-index:0; (which I normally do). I do have other elements on the page which have position:absolute; and position:fixed; and some high z-index s (500 & 1000).

How can I style an HTML INPUT tag so it maintains CSS when focused on Android 2.2+?

元气小坏坏 提交于 2019-11-29 01:30:27
问题 I was delighted to discover that Android 2.2 supports the position:fixed CSS selector. I've built a simple proof-of concept, here: http://kentbrewster.com/android-scroller/scroller.html ... which works like a charm. When I attempt to add an INPUT tag to my header, however, I hit trouble. On focus, every device I've tried so far clones the INPUT tag, gives it an infinite Z-index, and repaints it on top of the old tag. The clone is in roughly the right position, but most of its parent's CSS

Div with scrollbar inside div with position:fixed

你离开我真会死。 提交于 2019-11-29 01:28:02
问题 I have a div with position:fixed that is my container div for some menus. I've set it to top:0px, bottom:0px to always fill the viewport. Inside that div I want to have 2 other divs, the lower one of which contains lots of lines and has overflow:auto. I would expect that it would be contained within the container div, but if there are too many lines it simply expands outside the fixed div. Below is my code and a screenshot to clarify: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional/

Disable horizontal scrollbar due to a DIV with position:absolute which is outside of the page

这一生的挚爱 提交于 2019-11-28 23:41:30
问题 I have an absolutely positioned element that is "outside" of the page, but I want browsers (I am using Firefox 3) not to display horizontal scrollbars. It seems that displaying a div that is positioned to the left (e.g. having "left: -20px") is okay, and no scrollbar is shown. However the same thing on the right ("right: -20px") always shows the scrollbar. Is it possible to hide the scrollbar, but to keep standard scrolling possible? I mean I only want to disable scrolling due to this

Single finger Scrolling for inner contents (div/iframes) in iPhone Mobile Safari

自闭症网瘾萝莉.ら 提交于 2019-11-28 22:56:35
问题 Sub: iPhone mobile safari web application I need to keep some parts of a web page visible even when a user scrolls. The CSS property position:fixed does not work as expected. Using the overflow:auto property on or needs two-finger scrolling which is not what I want. Is there any way to provide single finger scrolling on the inner 'div' or 'iframes' contents using javascript or iphone safari Touch API (touchMove event)? 回答1: In CSS (for iOS 5): -webkit-overflow-scrolling: touch; 回答2: Natively

How do you do relative positioning in WPF?

僤鯓⒐⒋嵵緔 提交于 2019-11-28 22:19:04
问题 How can you relatively position elements in WPF? The standard model is to use layout managers for everything, but what if you want to position elements (on a Canvas, for example) simply based on the position of other elements? For example, you may want one element (say a button) to be attached the side of another (perhaps a panel) independent of the position or layout of that panel. Anyone that's worked with engineering tools (SolidWorks, AutoCad, etc.) is familiar with this sort of relative

Force “position: absolute” to be relative to the document and not the parent container

ε祈祈猫儿з 提交于 2019-11-28 22:12:53
I am trying to insert a div into any part of the body and make its position: absolute relative to the whole document and not a parent element which has a position: relative . You will have to place the div outside of the position:relative element and into body . You're looking for position: fixed . From MDN : Fixed positioning is similar to absolute positioning, with the exception that the element's containing block is the viewport. This is often used to create a floating element that stays in the same position even after scrolling the page. My solution was to use jQuery for moving the div