css-position

CSS Absolute Positioning of one div being affected by margin in unrelated div

微笑、不失礼 提交于 2019-12-10 16:23:18
问题 Given the following I would expect a 200px red box at the top of the page followed by a white space of 100 pixels then a purple box on the bottom. This is what the WYSIWYG view in Dreamwever shows me but what I get in FF IE Chr is a red box in the middle of the page. Funny thing is if I add a border to the wrapper div I get what I expect. So what is happening is that the margin-top:300px of the #content div is pushing down the #header div. Since the #header div is positioned absolutely inside

How can I contain an absolute positioned div in a relative positioned div?

你离开我真会死。 提交于 2019-12-10 15:18:09
问题 How can I contain an absolute positioned div inside a relative positioned div ? For example, a structure like this: .wrapper { position: relative; } .contentWrapper { position: absolute; top: 0; left: 0; } <div class="wrapper clearfix"> <div class="contentWrapper"> <div class="content">Looong text here...</div> </div> </div> Will result as the height of the contentWrapper to be 0 (when element inspected) and the div with the content class will not show. Is there a way to apply clearfix method

100% TextArea in FireFox using absolute position

寵の児 提交于 2019-12-10 14:55:23
问题 I'm trying to make my textarea to fill all available space, I used: I can't use 100% width & height as I have margins & paddings all over the place, I have to use absolute position within relative position parent + top , right , bottom & left all 0 - which doesn't work in FF. Any thoughts on how to fix it? Update 1 - when I replace my textarea with DIV it starts working. Update 2 - Actual markup: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD

Small dead space on a div button in chrome

霸气de小男生 提交于 2019-12-10 14:34:31
问题 I can't explain this one. I've got a div that's a button. I use the :active psuedo class and position: relative; to move it slightly down and to the right when clicked, to give it an animation. For some reason, there is a small dead space on this button in Chrome about half way between the text and edge of the button. The psuedo class still fires but the Javascript on the button does not. If I remove the position relative, the problem goes away. This also happens in Firefox, but the deadspace

CSS Relative Positioning Not Working

强颜欢笑 提交于 2019-12-10 13:25:59
问题 For some reason I cannot get my image to position to the right of the Twitter feed. I positioned it relatively within the DIV tags of the twitter feed, but it remains below. Here is the live link: http://www.lymemd.org/indexmm6.php My CSS: #twitterfeed { position: relative; } #drshow { position: relative; left: 200px; } My HTML: <div id="twitterfeed"> <a class="twitter-timeline" width="460" height="250" href="https://twitter.com/Lyme_MD" data-widget-id="453198382664667137">Tweets by @Lyme_MD<

position:fixed navigation stop at end of specific div - parallax scrolling & javascript

孤者浪人 提交于 2019-12-10 12:23:34
问题 I have a vertically oriented vertical navigation bar, that I would like to make stop at the end of #contact . It will need to resume scrolling again if the user scrolls back up. What is the best way to achieve this? javascript being used: $(function() { $.fn.scrollBottom = function() { return $(document).height() - this.scrollTop() - this.height(); }; var $el = $('#nav>div'); var $window = $(window); var top = $el.parent().position().top; $window.bind("scroll resize", function() { var gap =

Fixed div does not go beyond the screen's right edge

*爱你&永不变心* 提交于 2019-12-10 12:15:39
问题 I have a div which has a fixed position. The problem is when the div moves to the right it does not go beyond the screen's right edge. It resizes itself making its width smaller. This does not happen when I give it a fixed width . But I want it to have a fluid width with max-width defined. I do not want it to stick to the right edge by defining right . I want to define the left position and let the excess go out of the screen. You can see the problem here: http://codepen.io/anon/pen/BjZppJ

Keep element fixed while Safari navigation bar collapes on iOS

强颜欢笑 提交于 2019-12-10 11:58:53
问题 I'm developing a web site based on the Hyde theme for Jekyll. This layout uses a fixed navigation bar on the left with 100% width. This is working fine in most situations. In Safari on iOS, however, the height of the viewport changes while the user is scrolling as the browsers top navigation bar collapses. If this happens, the navigation bar's size is not updated until the scroll stops, leaving an area in the lower left corner that is not covered by the navigation bar: (Notice the text

css - How do I make the height of two right divs equal the height of the left divs

那年仲夏 提交于 2019-12-10 11:49:47
问题 I have a site that is divided into two classes: right and left. The left had 3 boxes in it and the right had one. The box on the right's height would stretch or shrink to be the same as the sum of the height's of the left boxes. I have added another box underneath the box on the right and I want the same effect now with the two boxes (the sum of the height of the two boxes on the right should always equal the sum of the height of the three boxes on the left. Here is the old code that worked

Sticky Headers with -webkit-overflow-scrolling CSS

半腔热情 提交于 2019-12-10 11:17:56
问题 Using a modified jQuery plugin we have developed a sticky headers scrolling box to imitate the native functionality on iOS in native apps with a cross browser solution that will work on all computers. Here is the FIDDLE: http://jsfiddle.net/f3y9s/1/ Everything is working including on iOS. Going further I would like to implement the native smoothing of iOS as well using -webkit-overflow-scrolling:touch. The problem is that this is causing the header to relocate once the scroll is complete