css-position

Position Fixed Not Working for Header

依然范特西╮ 提交于 2019-12-03 01:20:00
问题 I am trying to create a very simple effect where the navigation sticks to the top of the page as you scroll down the page. All I should have to do is set "position: fixed" to the header, which I currently have. For some reason, it's treating it more like a "position: absolute" element vs. fixed. I tried it on other elements on the page with the same effect, so I must have something that in my HTML or CSS code that is causing the issue. Any ideas? http://jsfiddle.net/apautler/yDhXG/1/embedded

IE 8 absolute positioned element outside its parent clipping problem

不想你离开。 提交于 2019-12-02 22:53:00
I have an absolute positioned div inside another absolute positioned div. The child div content is much bigger than the parent can contain. This is by design. I need the child div to spill out of its parent. It does so in every other browser except IE 8 (IE 7 looks OK, not sure) In IE8 the part of the child that is out of parent is clipped. It is there, but just not visible as can be verified by IE developer tools. I tried z-index, tried explicitly setting overflow:visible, no luck at all. UPDATE: I found out that the problem is caused by a filter defined in the parent div like this: -ms

Position by center point, rather than top-left point

一笑奈何 提交于 2019-12-02 20:02:53
Is it possible to tell the code to position by the center point of an element, rather than by the top-left point? If my parent element has width: 500px; and my child element has /*some width, for this example let's say it's 200px*/ position: absolute; left: 50%; one would assume that based on the 50% positioning, the child element will be in the middle of the parent, leaving 150px of free space on each side. However, it is not, since it is the top-left point of the child that goes to 50% of the parent's width, therefore the whole child's width of 200px goes to the right from there, leaving

Div is shown in wrong position

谁说我不能喝 提交于 2019-12-02 19:31:09
问题 I have such code: <div style="position:relative"> <div style="float:left; width: 183px; background-color:#c1cba9; color: #000000;"><img border="0" alt="Product categories" title="Product categories" src="http://www.gvcdigital.co.uk/images/graphic/categrieshead.png" width="179" height="43"><br /> <div style="margin-left: 10;"><ul><li><a href="/Digi-Spot/Sound-Vision-/_i.html?_sacat=293&_sid=560455030&_trksid=p4634.c0.m322">Sound & Vision</a><span class="cnt"> (9943)</span></li><ul class="lev2"

How to do a `float: left` with no wrapping?

家住魔仙堡 提交于 2019-12-02 17:07:38
I have a container box1 that has a certain width (which might change depending on its content). That box contains box2 which has a fixed width (it could be an icon). Next to box2 , I have box3 with some text. I want the text to use all the space available to the right of box2 . With the HTML pasted below, you get: So far so good. If the text gets longer, it doesn't wrap around box2 (which is what I want), however, it doesn't make box1 grow, which is my problem. You'll tell me "hey, if you made box3 a position: absolute , how could you expect it to make box1 grow?". Well, I don't but then, how

Position Fixed Not Working for Header

心已入冬 提交于 2019-12-02 14:39:11
I am trying to create a very simple effect where the navigation sticks to the top of the page as you scroll down the page. All I should have to do is set "position: fixed" to the header, which I currently have. For some reason, it's treating it more like a "position: absolute" element vs. fixed. I tried it on other elements on the page with the same effect, so I must have something that in my HTML or CSS code that is causing the issue. Any ideas? http://jsfiddle.net/apautler/yDhXG/1/embedded/result/ Header CSS .nav-main {overflow: visible; position: fixed; top: 0; left: 0; right: 0; height:

Issue when using position: fixed for toolbar in iOS 5 (iPad and iPhone)

我是研究僧i 提交于 2019-12-02 10:53:24
There's an issue when accessing my website (http://www.zero11arquitetura.com.br) on iPad or iPhone with iOS 5 that I can´t fix. When window is scrolled thru code every position:fixed elements click event stop working. Can you please help me ? This site structure uses a top menu div and a header div with position: fixed css. When user clicks on a menu item window scrolls horizontally until it reaches its target. Clicking in the menu item is done by jQuery click method on each img tag and scrolling is done by jQuery animate method ($("html:not(:animated),body").animate({ scrollLeft: varDestino }

Scrolling fixed header not showing on mobile device

穿精又带淫゛_ 提交于 2019-12-02 10:48:12
问题 I have a fixed header that changes to a sticky header on scroll using JS. The dropdown menu works when in mobile view showing on Google Dev Tools and Firefox Responsive Design Mode, however it doesnt work on actual mobile devices. I've tried changing the Z-index and webkit-backface-visibility. The HTML: <header id="myHeader" class="site-header" role="banner"> <div class="nav-container"> <nav id="top-bar"> <div class="row" id="top-bar"> <div class="top-bar-text"> </div> </div> </nav> <nav id=

CSS Flexbox: a centered child overflows a parent with position fixed

牧云@^-^@ 提交于 2019-12-02 10:07:50
问题 How can I properly center the #content without overflowing the #container ? margin: auto kinda works, but looks like a hack to me, I would like not to use any margins with CSS Flexbox. Keep in mind that the #container has position: fixed . Here's the code demonstrates the issue: [View in JSFiddle ↗] document.getElementById('content').innerHTML = [...Array(100).keys()].join('<br>') #container { position: fixed; background: lightblue; top: 0; bottom: 0; left: 0; right: 0; display: flex; align

Center parent div with float children

蹲街弑〆低调 提交于 2019-12-02 08:48:06
问题 Parent hasnt got a defined width because there are unknown number of children inside. Why do children fall into new line and how to prevent that? Children need to be on the same line. .wrap { position: absolute; left: 50%; top: 50px; height:40px; transform: translateX(-50%); } .box { width:40px; height:40px; float:left; background:red; margin-right:1px; } <div class="wrap"> <div class="box">0</div> <div class="box">1</div> <div class="box">2</div> <div class="box">3</div> <div class="box">4<