css-position

Relative positioning of two divs

妖精的绣舞 提交于 2019-12-23 03:15:09
问题 I made this fiddle, I am expecting the red div to be positioned directly below the yellow one. They are not. How can I position both the div up and down relative to wrapper ? Guessing it should be simple, but I can't get it to work. I think I need to use relative . The 'bars' are time lines and 'float around' freely. HTML: <div class="wrapper" style="background:blue"> <div class="up" style="background:yellow"/> <div class="down" style="background:red"/> </div> CSS: .wrapper { width:50px;

Relative positioning of two divs

半城伤御伤魂 提交于 2019-12-23 03:15:05
问题 I made this fiddle, I am expecting the red div to be positioned directly below the yellow one. They are not. How can I position both the div up and down relative to wrapper ? Guessing it should be simple, but I can't get it to work. I think I need to use relative . The 'bars' are time lines and 'float around' freely. HTML: <div class="wrapper" style="background:blue"> <div class="up" style="background:yellow"/> <div class="down" style="background:red"/> </div> CSS: .wrapper { width:50px;

iFrame with Fixed Header

帅比萌擦擦* 提交于 2019-12-22 12:27:34
问题 I would like to do something similar to this: http://bit.ly/RLpHme I'm working on a website for a real estate agent, and she would like to load the listings from her partners site, but have a fixed header at the top with her information. How would I go about achieving this? Thanks for the help! 回答1: fixed header with iFrame, check http://jsfiddle.net/QQKc4/50/ <div id="headerfix"></div> <iframe id="preview-frame" src="http://www.test.com" frameborder="0"></iframe> CSS #headerfix { height:

jQuery offset returns invalid value for <span> or inline <div>

廉价感情. 提交于 2019-12-22 10:13:15
问题 I've created a test case, please check it out as it illustrates my issue: http://jsfiddle.net/jAD2W/6/ (reduced example thanks to @patrick dw) For completeness, this code has also been added to the bottom of this post. Basically, whenever I get the offset of a span element or inline div element, the top value is larger than it should be. When you mouse-over the image in the example, it should stay at that absolute position. Unfortunately, it appears to be moved down. What is causing it to

Using scrollTop inside of a fixed element with overflow-y:scroll

我的未来我决定 提交于 2019-12-22 09:49:31
问题 I can't seem to get scrolltop to work when my content is inside of a fixed position container that has overflow-y: scroll specified. Here is my relevant code: /* some container with many large content blocks inside */ #container { position: fixed; width: 300px; height: 300px; overflow-y: scroll; } /* button that has a data-path attribute that specifies where the container should scroll to*/ $(".button").on("click", function(){ var path = $(this).attr("data-path"); var anchor = $("#" + path);

Why does Firefox 4 absolutely position fieldset legends differently than other browsers?

寵の児 提交于 2019-12-22 09:49:28
问题 Why does Firefox 4 absolutely position fieldset legends differently than other browsers? Test page: <!DOCTYPE html> <html dir="ltr" lang="en"> <head> <meta charset="utf-8"/> <title>Test</title> <style type="text/css"> * { margin: 0; padding: 0; } body { font-family: Tahoma, Arial, sans-serif; font-size: 62.5%; } #wrapper { margin: auto; padding: 1em; width: 720px; } form { width: 670px; padding: 25px; background-color: #ffffff; /* White */ color: #000000; /* Black */ border: 1px solid #cccccc

Fixed position element inheriting width of flex item

喜欢而已 提交于 2019-12-22 08:59:36
问题 I'm building out a UI that requires a fixed position/sticky element at the bottom of the viewport with a width constrained by a main content area. The main content area is optionally flanked by (sibling) left and/or right sidebars with fixed widths, so I'm using Flexbox to build the three column structure with flex-grow: 1 on the main content. I've learned from @Marc Audet's accepted answer at How can I make a fixed positioned div inherit width of parent? that setting width: inherit on the

Fixed non scrolling footer inside a div?

情到浓时终转凉″ 提交于 2019-12-22 06:08:11
问题 I am making a small div on the center of the page which has a footer which is fixed but the div is scroll-able. According to me there are two ways to do it: Using position:fixed : Fixed position actually work relative to the browser window but I want position relative to my small div Using position:absolute : Using bottom:0; I solved the problem initially but the footer scroll with the div text. HTML : <div id="wrapper"> <div id="box"> <div id="header"> <h1>Heading</h1> </div> <div id=

Side-by-side blocks using CSS

亡梦爱人 提交于 2019-12-22 05:34:34
问题 I want to have block elements side-by-side. I don't don't want to use left, right, top , or anything similar. HTML <div class="iLB">LOLOLOL</div> <div class="iLB"> This is content.<br/> This is content.<br/> This is content. </div> <div class="iLB">This, too?</div> CSS .iLB { display: inline-block; } Live demo: jsFiddle 回答1: Use vertical-align:top; .iLB { display: inline-block; vertical-align: top; }​ JSFiddle : http://jsfiddle.net/97wDh/1/ 回答2: As you are using display: inline-block it's

How to center a tooltip horizontally on top of a link

梦想的初衷 提交于 2019-12-22 05:19:09
问题 I'm trying to get a tooltip box to be inserted on top and centered of an a tag. I have this working for small Text, but I can't seem to get it to center on large text. I understand it has to do with positioning the box and the arrow but I can't seem to find the right combination to get the arrow centered under the box and the box centered above the a tag. I'm hoping to accomplish this with just CSS alone. HTML: <div> <a class="tooltip" href="#" title="tooltip"> <span>Text</span> </a> </div>