css-position

how to set height of relative layout dynamically in android

回眸只為那壹抹淺笑 提交于 2019-12-19 07:58:15
问题 This is working fine on emulator but not on the devices because I have hard coded the height to 365. Can anyone help me in this regard? <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TabHost android:id="@+id/tab_host" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TabWidget android:layout_width=

Placing absolute behind relative positioned element

匆匆过客 提交于 2019-12-19 05:02:06
问题 I have two elements in the same container, the first has position: absolute , the second position: relative . Is there a way to set the "z-index" of an absolute element so that its in the background? The relative positioned element should be on the top (z-layer) because it holds links... Here is a JSFiddle: http://jsfiddle.net/8eLJz/ The absolute positioned element is on the top of the z-layer and I have no influence with the z-index -property. What can I do? 回答1: I'm not sure which one you

Absolutely positioned flexbox doesn't expand to fit contents [duplicate]

ぐ巨炮叔叔 提交于 2019-12-18 18:41:22
问题 This question already has answers here : When flexbox items wrap in column mode, container does not grow its width (4 answers) Closed 2 years ago . As you can see from the Snippet below (View as Fiddle), an absolutely positioned, columnar flexbox won't expand to fit its children. In Chrome, for example, it will only be as wide as the widest child element and as tall as the shortest column. Can anyone suggest a solution without using any additional markup? Edit: The number of items in the list

graphviz - fixed node positions

懵懂的女人 提交于 2019-12-18 16:31:54
问题 I have a graph that is processed by neato and I'm adding new edges to it. However, I don't want that the old nodes to be moved. I want that neato computes the new positions of the new nodes and the old nodes stay in the same place. strict graph { node0 [pos="1,2"]; node1 [pos="2,3"]; } and I add new edges: strict graph { node0 [pos="1,2"]; node1 [pos="2,3"]; node1 -- node2 [len="3"]; ... } I want to get the same positions on the old nodes. For example: strict graph { node0 [pos="1,2"]; node1

graphviz - fixed node positions

白昼怎懂夜的黑 提交于 2019-12-18 16:31:53
问题 I have a graph that is processed by neato and I'm adding new edges to it. However, I don't want that the old nodes to be moved. I want that neato computes the new positions of the new nodes and the old nodes stay in the same place. strict graph { node0 [pos="1,2"]; node1 [pos="2,3"]; } and I add new edges: strict graph { node0 [pos="1,2"]; node1 [pos="2,3"]; node1 -- node2 [len="3"]; ... } I want to get the same positions on the old nodes. For example: strict graph { node0 [pos="1,2"]; node1

Why does position absolute make page to overflow?

吃可爱长大的小学妹 提交于 2019-12-18 13:07:02
问题 My understanding is once an element is positioned absolute (even with a negative position value), it will completely out of the normal content flow. But why does it still make the page to overflow? When you run code snippet below, the horizontal scrollbar appears, I thought it shouldn't be there. .relative { position: relative; background: pink; } .absolute { position: absolute; top: 0; right: -100px; width: 200px; height: 100px; background: rgba(0,0,0,.5); } <div class="relative">

Why doesn't top: 0 work on absolutely-positioned elements relative to body?

 ̄綄美尐妖づ 提交于 2019-12-18 12:53:04
问题 You can see in the code below that the h1 pushes down the body and the absolutely-positioned block .absolute does not stick to the top. But you also can see that the same block is stuck to the top of its parent .wrapper . Why? I'm not asking how to do that trick; I know how, e.g. padding instead margin to h1, or clearfix to parent and so on. I'm interested in only one thing: why h1 's margin pushes down the body , but is not pushing down .wrapper ? body { position: relative; margin: 0;

how to make DIV height 100% between header and footer

谁说我不能喝 提交于 2019-12-18 11:57:26
问题 Is there a way to setup a layout so that the header is 50px, body is 100% and footer is 50px? I would like the body to use up the entire viewing area at minimum. I would like to have the footer and header to be on the screen at all times 回答1: I created an example in jsfiddle: UPDATED JsFiddle: http://jsfiddle.net/5V288/1025/ HTML: <body> <div id="header"></div> <div id="content"><div> Content </div></div> <div id="footer"></div> </body> CSS: html { height: 100%; } body { height:100%; min

Position fixed on chrome mobile causing element to move on scroll up/down

狂风中的少年 提交于 2019-12-18 10:53:53
问题 I'm facing this strange issue that looks like a bug on Chrome mobile. I have a div with position:fixed; aligned to the top right corner of the screen. On desktop, it works fine (it stays in place), in mobile, however, the div is moving when I scroll up or down. I made a video to explain it better: https://www.youtube.com/watch?v=gCgN6ULkcMg On scroll up works fine on scroll down, a piece of the div with position:fixed disappears outside the viewport I tried to isolate the problem on a fiddle,

Center an item with position: relative

断了今生、忘了曾经 提交于 2019-12-18 10:46:41
问题 I've got a menu that appears on hover over an absolutely positioned div. All of the menu items have to be relatively positioned because the absolutely div will appear multiple times on a page and will appear in multiple sizes in one instance. How would I center multiple items with position: relative both vertically and horizontally when I won't know the the size of the parent div? I know the position: absolute trick with negative margins, but this situation calls for something different. Here