css-position

Creating CSS circles connected by lines to middle main circle

柔情痞子 提交于 2019-12-03 21:58:20
I need to create a page something like this. The blue circle is the main circle and green circles should place around the main circle. The green circles count is random (around 0 - 10). All green circles are connected to blue circle with a line. I know to draw circle in CSS. I need to know, How to place green circles around the blue circle How to connect green circles to the blue circle Is it possible to do with CSS. If not what is the way? Thank you. What you will need is a position: relative; container with child elements positioned absolute Demo Demo 2 (Using transform ) Explanation: What

How do I centre absolutely positioned content of unknown width?

二次信任 提交于 2019-12-03 18:40:13
问题 Before someone asks me why the hell I would want to do this let me come straight out and tell you. That way one of you clever peeps out there can tell me a far better way... I'm making a viewer for paintings which should stretch to fill the page, well 90% of the height of the screen to be precise. I want to fade the paintings in one over the other and want to center each of them in the middle of the screen. To fade the paintings in over each other I need to position them 'absolute' to stop

IE 10 elements with relative position disappearing after scrolling in parent element

▼魔方 西西 提交于 2019-12-03 17:30:13
Elements with position: relative , located inside table cells in a big table disappear in Internet Explorer 10 on Windows 7 in a particular case: Scroll down the page Scroll the div#scroller to the right Scroll to top All browsers work as expected, IE10 shows blank table cells At this point, resizing IE10 window will trigger correct display of cell contents. Big table, all cells identical: <td><div>Foo bar</div></td> CSS: td div { position:relative; } Here's an extremely simplified demo: http://jsfiddle.net/86BaU/ This is a known and reported bug in IE10. However, MS seems unwilling to do

Absolute positioning with percentages giving unexpected results

大憨熊 提交于 2019-12-03 16:20:52
问题 Please consider this jsfiddle, containing this html code: <div id="container"> <div id="item">TEST</div> </div> And some CSS: #container { border: 1px solid red; height: 100px; width: 100px; } #item { border: 1px dashed purple; position: absolute; left: 50%; } The results surprise me. Looking at the W3 positioning props I'd expect the #item to have its left value at 50% of the "containing block": the #container . However, it seems to be at 50% of the entire page, not just the containing block

How to hover a Fixed element until it reaches some point

江枫思渺然 提交于 2019-12-03 16:16:04
问题 I've got a div which I need to be fixed to the bottom of the screen, until it reaches some point after scrolling and stop there and stay. If a user start scrolling back up - make it fixed again after passing that same point. Any ideas on how this can be accomplished? EDIT: (here's my current code which doesn't work) $(window).scroll(function () { if ($(this).scrollTop() < $(document).height() - 81) { $('#bottom_pic').css('bottom', "0px"); } else { $('#bottom_pic').css('bottom', "81px"); } });

Fixed headers with text fields on mobile safari websites

筅森魡賤 提交于 2019-12-03 16:08:16
I've been looking around for awhile, and I can't seem to find any fix for this issue. When an input field gains focus in mobile safari (haven't checked other browsers) a fixed element will jump due to safari putting that element in view (closer to the center). The error only occurs when a user has scrolled, if the user is still at the top of the page nothing occurs. Before & After screenshots Does anyone have a clue how to fix this? The only solution I have come across is to scroll back to the top when focused, then on blur scroll back into position... this seems like a very sloppy solution.

CSS z-index not working (position absolute)

老子叫甜甜 提交于 2019-12-03 14:23:15
问题 I am trying to make the black div (relative) above the second yellow one (absolute). The black div 's parent has a position absolute, too. #relative { position: relative; width: 40px; height: 100px; background: #000; z-index: 1; margin-top: 30px; } .absolute { position: absolute; top: 0; left: 0; width: 200px; height: 50px; background: yellow; z-index: 0; } <div class="absolute"> <div id="relative"></div> </div> <div class="absolute" style="top: 54px"></div> Expected Result: 回答1: Remove z

Is it possible to keep the width of the parent element when position: fixed is applied?

佐手、 提交于 2019-12-03 14:20:45
问题 When we apply position:fixed to an element, it's taken out of the normal flow of the document, therefore it doesn't respect it's parent's element width. Are there ways to make it inherit it's parent's width if this is declared as a percentage ? (working use case below) let widthis = $('.box').width(); $('.dimensions').text(`width is ${widthis}`); $('button').on('click', function() { $('.box').toggleClass('fixed'); let widthis = $('.box').width(); $('.dimensions').text(`width is ${widthis}`);

Absolute positioned item in a flex container still gets considered as item in IE & Firefox

妖精的绣舞 提交于 2019-12-03 13:40:12
If I have multiple elements with the property justify-content: space-between in a flex container and I want to absolute position one of them and remove from the flex flow, as showed here: This works in Chrome but not in IE and Firefox as the absolute positioned element is considered as 0 width, but still in the flex flow: Is there a fix to this keeping the layout as it is? CodePen It turns out that all it takes is three simple steps ( Demo ) 1). Set the left and right margin to auto on each child img { margin-left: auto; margin-right: auto; } 2). Set the left margin on the first child to 0 img

Fixed menu on left and content scrollable

别等时光非礼了梦想. 提交于 2019-12-03 12:57:45
问题 I would like to have a menu which is fixed on left and the content is scrollable on the right. What I want to do is exactly like this website: http://other.wpengine.com/ The menu fixed and content scrollable. Could you guys help me out? Thanks in advance! 回答1: Quick one from me, check it out. You should at least have tried yourself, but I wasn't doing much so that's why I made something. HTML: <div id="left">Side menu</div> <div id="right">Scroll <br />Scroll <br />Scroll </div> CSS: html,