css-position

Android: Find absolute click position on the ImageView after zooming (using pinch to zoom using Matrix Layout)

烂漫一生 提交于 2019-12-03 08:48:35
I am using code found in Hello Android, 3rd Edition for Pinch to Zoom functionality. After using this the pinch to zoom works fine, but after zooming i want to get the absolute click position on the image view. Here is my code package org.example.touch; import android.app.Activity; import android.graphics.Bitmap; import android.graphics.Matrix; import android.graphics.PointF; import android.os.Bundle; import android.util.FloatMath; import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; import android.widget.GridView; import

The width of div with absolute position depends on its parent's width?

你。 提交于 2019-12-03 08:12:49
I'd like to have the width of a div with absolute position depending on its content rather than its parent. For example, <div style="position:absolute"> <div style="position:absolute"> <div style="position:absolute">Div in Div</div> </div> </div> will cause word wrap as shown in http://jsfiddle.net/ymgfN/2/ It looks like the inner div's width will depend on its parent's width, even though its position is absolute. For example, if we specify width to its parent, it will work as expected (no word wrap): http://jsfiddle.net/ymgfN/3/ Unfortunately, I can't specify the parent's width in advance --

Position element inside absolute parent with respect to grandparent

南笙酒味 提交于 2019-12-03 07:44:17
问题 I have child element which need to be positioned absolute with the grandparent. The problem is that the parent is also positioned absolutely. I can't use JavaScript. How can I achieve this with just pure CSS? JSFiddle Demo <div class="col-md-6 gp"> <div class="col-md-4 p"> <div class="col-md-2 c"> position me w.r.t to .gp</div> </div> </div> .gp { height : 200px; position: relative; } .p { height : 100px; width: 250px; position :absolute; top : 50px; left: 50px; } .c { position: absolute;

Why does `position:fixed` not work when viewed in an `iframe` using an iPhone or iOS device?

心不动则不痛 提交于 2019-12-03 06:10:29
I've looked into stackoverflow and it seems that position:fixed in an iframe for iOS mobile devices has been an issue in the past but have yet to have an answer. Here's an example I created via jsbin: http://jsbin.com/pekeca/1/ In that example, there is a parent HTML page that uses iframe which contains another HTML page (child). Here are the things to note: When the parent HTML is viewed on any device, the navigation bar in the child HTML stays fixed. This is the intended behavior. However, when the parent HTML is viewed on an iPhone regardless of the browser, the navigation bar in the child

CSS z-index not working (position absolute)

折月煮酒 提交于 2019-12-03 04:09:20
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: Remove z-index:0; from .absolute . Updated fiddle here. This is because of the Stacking Context , setting a z-index will

Fixed Position div Vertical Only

放肆的年华 提交于 2019-12-03 04:04:14
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 those who actually considered helping. Keep the fixed div. And have the following javascript code which

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

余生颓废 提交于 2019-12-03 03:40:14
问题 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

Position relative, float takes div out of the normal flow

六眼飞鱼酱① 提交于 2019-12-03 03:36:36
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. 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 relative info is quoted below: Techniques for Clearing Floats If you are in a situation where you always know

Fixed menu on left and content scrollable

吃可爱长大的小学妹 提交于 2019-12-03 03:13:32
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! 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, body { height: 100%; margin: 0; font-size: 20px; } #left { width: 20%; height: 100%; position: fixed; outline:

Show number of notifications on icon

一世执手 提交于 2019-12-03 02:04:50
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:;" id="notification-center" class="icon-set globe-fill" data-toggle="dropdown"><span class="bubble">2<