css-position

Fixed Position div Vertical Only

房东的猫 提交于 2019-12-03 12:57:21
问题 I have a current web build with a right sidebar that is a fixed position. I have tried to positioning from the right but don't want it overlapping other divs content. What I am looking for is to have the content scrollable horizontally to the right when it is out of the viewport window. Any help would be greatly appreciated. similarly to this: http://demo.rickyh.co.uk/css-position-x-and-position-y/ however I can not get this working. This has been solved by alternative method. Thanks for

Setting 100% height on an absolutely positioned element when the content expands past the window size

筅森魡賤 提交于 2019-12-03 12:35:52
So after reading Stack Overflow and the web, I've gathered that there are two main tricks to achieving 100% height: Set height:100% on both the HTML and BODY Set your element to have either: height:100%, or top:0, bottom:0, position:absolute However, even with those tricks I'm having difficulty setting the height of an absolutely positioned DIV to a true 100%. I can get 100% of the viewport size, but if the user scrolls down at all it becomes apparent that the div doesn't truly have 100% height. I've made a simple JS Fiddle of the situation here: http://jsfiddle.net/9FEne/ My question is: does

CSS “transform: rotate()” affecting overall design with “position: absolute” (not aligning properly)

不打扰是莪最后的温柔 提交于 2019-12-03 12:34:14
I fear I quite don't know how to explain it as well as I can show it. So I've set up this Fiddle. As you can see, the nav menu is not where it should be. It should be set exactly at the bottom border of the head element and to the left border. I.e. bottom: 0 and left: 0 . However, I'm setting a rotation of -90degs and it is obvious that the absolute positioning on the nav element is happening before the rotation or perhaps rather on the original element as if the rotation didn't exist. I've tried using :before and :after pseudo-elements to try and see if I could solve it that way. But I can't

CSS how to position element in half height (vertical 50%)

纵饮孤独 提交于 2019-12-03 12:34:01
I'm looking forward to build a tooltip which is positioned next to the element. It's easy to put it over and under in the center of element. But is there a way to do so vertically (on the right or left side of element vertically positioned in a middle of elements height)? For my purpose, height of the element is known & height of tooltip is not. And tooltip can be a child of element. But, I'm also curious about how to do it when both heights are unknown. By heights I understand element's and tooltip's height. Width can be known and fixed. This is pretty late but I tried to make an example on

Position relative, float takes div out of the normal flow

落爺英雄遲暮 提交于 2019-12-03 12:21:52
问题 How can i prevent taking div out of the normal flow but still using float, like this: <div id="one"> <div id="two"></div> </div> CSS: #one { width: 100%; height: auto; } #two { width: 100px; height: 100px; position: relative; float: left; } Now div "one" has no height and div "two" just looks like it isn't in the first div. 回答1: Ahh, the collapse problem. There's an excellant article about floats here http://css-tricks.com/all-about-floats/ In your case, I'd add overflow: auto to #one The

need help CSS centering with absolute positioning

六月ゝ 毕业季﹏ 提交于 2019-12-03 11:58:03
I've never been totally satisfied with my various solutions to centering content in a web page. the <center> tag has been deprecated back in the middle of the 18th century, but I fail to see a reasonable alternative. Specifically what I want is to have a parent DIV that is centered, but against whose upper left hand corner I can set things "absolutely". Is there a way to accomplish this without using window.onresize javascript that remeasures everything? It seems like a fairly straight forward idea... I want things absolutely positioned, I just want the 0,0 coordinate to be relative to

Show number of notifications on icon

强颜欢笑 提交于 2019-12-03 11:47:09
问题 I have a notification icon (font-awesome) which shows the number of notifications. I am having a problem trying to get the number to display in the correct position, as shown in see below image I need the text to be smaller and move right and up a little... here is the code .header .bubble { border-radius: 100%; height: 14px; width: 14px; background-color: rgba(226, 32, 91, 0.77); color: #ffffff; text-align: top; position: relative; top: 0px; float: right; right: -3px; } <a href="javascript:;

Absolutely positioning images inside relatively positioned div

青春壹個敷衍的年華 提交于 2019-12-03 11:04:33
I've seen several posts related to this issue, but still can't get the following to work: .container { position: relative; width: 100%; } .left { position: absolute; left: 0px; } .right { position: absolute; right: 0px; } <html> <body> <div class="container"> <img src="..." class="left" /> <img src="..." class="right" /> </div> </body> </html> According to http://www.w3schools.com/css/css_positioning.asp , specifically the line that says: An absolute position element is positioned relative to the first parent element that has a position other than static. If no such element is found, the

Preserve normal word wrapping inside absolutely positioned container

两盒软妹~` 提交于 2019-12-03 09:42:01
I have an absolutely positioned block of text inside a relatively positioned container. The absolutely positioned element exceeds the right boundary of its container. The problem is: the text isn't wrapping as normal; it's breaking prematurely rather than expanding to its defined max-width : Observed behavior: Desired behavior HTML/CSS ( JSFIDDLE : http://jsfiddle.net/WmcjM/ ): <style> .container { position: relative; width: 300px; background: #ccc; height: 100px; } .text { position: absolute; max-width: 150px; left: 290px; top: 10px; background: lightblue; } </style> <div class="container">

IE 8 absolute positioned element outside its parent clipping problem

て烟熏妆下的殇ゞ 提交于 2019-12-03 08:53:50
问题 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.