css-position

Why isn't z-index working?

本小妞迷上赌 提交于 2019-11-30 23:38:58
问题 I am trying to understand how z-index works. In order to do that, I have created a simple example which consists of five divs. Each one is a child of the previous, except for the first. My objective is to make the first div, the parent container of all other divs, be shown on top of all of the others, effectively hiding them. In order to achieve my goal, I have put z-index properties on all the divs and on the parent div I have put an exaggerated value of a 100 to make sure it is higher than

How to prevent hidden element to be shown when focused in Chrome?

我的未来我决定 提交于 2019-11-30 22:18:39
I have a strange problem today, in Chrome, when I focus on an element that is absolutely positioned out of its overflow hidden container, it gets visible in Chrome browser (Mac). I've made a fiddle to illustrate the problem : http://jsfiddle.net/GHgtc/ Html <div id="container"> <a id="inner-button" href="#">You can see me !</a> </div> Css #container{ display: block; background: blue; width: 200px; height: 30px; position: relative; overflow: hidden; } #inner-button{ display: block; background: red; width: 20px; height: 20px; position: absolute; top: 5px; right: -20px; } Thanks for your help !

Page Down key usability with a fixed position bar at the top of a page

我怕爱的太早我们不能终老 提交于 2019-11-30 20:43:43
If you have a absolutely positioned (position: fixed) bar at the top of a page, as many websites do, it breaks the behavior of the Page Down button (and also Page Up). Instead of Page Down leaving you with a line or so of text at the top of your screen that was previously at the bottom of the screen to make continued reading easier, there is a little bit of cutoff that is very annoying. Here is a contrived example of this. Is there any way of working around this problem (besides avoiding fixed position bars at the top of pages)? The source code of the above linked example is repeated below for

Why doesn't translateX work as expected for fixed elements on IE9, IE10, and IE11?

帅比萌擦擦* 提交于 2019-11-30 19:48:52
I'm trying to achieve the following in IE9, IE10, and IE11 (works perfectly on Chrome and FF): In mobile mode, I have a main #container wrapper that holds the entire site contents and a nav side menu div which is inside the #container (cannot be moved out, btw), yet is not visible and is hidden off-screen. When a user clicks a menu open toggle button, it should slide the #container to the right, revealing the nav side menu div directly positioned to its left. The "sliding" is happening using translateX, which gets assigned as soon as the "open" class gets applied to it via the toggle. In the

Absolutely positioned flexbox doesn't expand to fit contents [duplicate]

孤者浪人 提交于 2019-11-30 17:06:10
This question already has an answer here: When flexbox items wrap in column mode, container does not grow its width 4 answers As you can see from the Snippet below ( View as Fiddle ), an absolutely positioned, columnar flexbox won't expand to fit its children. In Chrome, for example, it will only be as wide as the widest child element and as tall as the shortest column. Can anyone suggest a solution without using any additional markup? Edit: The number of items in the list will be dynamic, as will the text in each item. I need to break to a new column after a set number of items. *{box-sizing

Prevent absolutely-positioned elements from overlapping with text

情到浓时终转凉″ 提交于 2019-11-30 16:39:41
问题 I have a unique situation here. Essentially, I have an absolutely positioned block of text, which must be absolutely positioned due to design limitations. I also have the rest of my text, which is normally positioned. However, I need to prevent my normal text from overlapping with my original text. Is this possible simply with HTML and inline CSS? I do not have access to JavaScript or external/ head -related CSS; only inline styles are available. I have created a simplified version of my CSS

Content scrolling on mobile page with fixed header/footer

杀马特。学长 韩版系。学妹 提交于 2019-11-30 16:25:33
Hello i am building a mobile webpage where my content only will be scrolling and my footer and header is position:fixed - Can i make the content so that it doesn't scroll under the header or footer , so that it just scrolls in it's own div. The reason why i want to do this is that i am going to have some opacity on my header and footer and if the content gets scrolled under , it's just not looking good. Heres a jsfiddle i made to just show you the example of the scroll http://jsfiddle.net/VNVqs/ Here you are: http://jsfiddle.net/VNVqs/3/ I just removed the position: absolute to the scrolling

Position:absolute without top/left/bottom/right values

≯℡__Kan透↙ 提交于 2019-11-30 16:15:24
问题 I need to take an element out of the flow an am using position:absolute; for that. Now if I just set position:absolute; without giving any top/bottom/left/right values or giving a relative position to the parent, the element sits right where I want it to be. Here is a FIDDLE html : <div id="parent"> <div id="absolute">.. Absolute div ..</div> </div> CSS : #parent{ width:50%; margin:10% auto; background:gold; height:20%; } #absolute{ position:absolute; background:lightgrey; padding:2%; } Is

Content scrolling on mobile page with fixed header/footer

被刻印的时光 ゝ 提交于 2019-11-30 16:03:27
问题 Hello i am building a mobile webpage where my content only will be scrolling and my footer and header is position:fixed - Can i make the content so that it doesn't scroll under the header or footer , so that it just scrolls in it's own div. The reason why i want to do this is that i am going to have some opacity on my header and footer and if the content gets scrolled under , it's just not looking good. Heres a jsfiddle i made to just show you the example of the scroll http://jsfiddle.net

Position:absolute without top/left/bottom/right values

别说谁变了你拦得住时间么 提交于 2019-11-30 15:43:02
I need to take an element out of the flow an am using position:absolute; for that. Now if I just set position:absolute; without giving any top/bottom/left/right values or giving a relative position to the parent, the element sits right where I want it to be. Here is a FIDDLE html : <div id="parent"> <div id="absolute">.. Absolute div ..</div> </div> CSS : #parent{ width:50%; margin:10% auto; background:gold; height:20%; } #absolute{ position:absolute; background:lightgrey; padding:2%; } Is there a reason not to do this? Should I realy give the element top/left values and the parent a relative