css-position

How to align two columns of text in CSS

我怕爱的太早我们不能终老 提交于 2019-12-02 01:07:11
I'm having some trouble lining up some text. I need two columns, one with numbers and one with text, like so: 1 Entry one 2 Entry two 3 Entry three 4 Entry five 5 Entry six The left column is Georgia and the right column is Arial (slightly different font sizes). I could have a container div for each row and absolutely position the number and text paragraphs to be at the top or bottom of these, which works fine. The problem is this means I have to give each row a fixed height so that it displays properly, which causes a problem if the text needs to flow onto more than one line (which it may

position: fixed overlapping page

有些话、适合烂在心里 提交于 2019-12-02 01:06:23
Here is the fiddle . I am making a grocery list web app, and I am making the top div a fixed position. When I do this, the div seems to overlap the rest of the page. I have tried using two positions in the css ( position: relative; position: fixed ) but this doesn't let the div stay fixed. CSS (for the div): #top { width: 100%; height: 40px; background: #96f226; text-align: center; font-size: 30px; color: #252525; position: relative; position: fixed; } HTML (for the div): <div id='top'>Kitchen List</div> Wrap your content with div and give it the margin-top to the same height as your fixed

Position element above mobile keyboard

本秂侑毒 提交于 2019-12-01 22:48:06
I'm trying to position an element directly above a mobile keyboard. ie: position absolute/fixed to bottom of page, but pushed up by the keyboard (or pushed up equivalent height of the keyboard). Usually this is the opposite behavior of what's desired, and there's to be a lot of people fighting to keep bottom elements in place. I feel like I remember fighting those same battle before... But now that I want it to move, it's not. (of course!) My focus is iOS Safari for now, but would prefer cross browser. It seems older versions of iOS changed window.innerHeight when the keyboard opened, for

Relative and absolute positioning confusion

北城余情 提交于 2019-12-01 22:32:44
问题 I'm new to html/css and I've just started wrapping my head around positioning but I seem to have a misunderstanding. Right now I'm trying to create a page header with a horizontal divider right below it. My header is positioned absolutely, with a top and left value of 0, and a height of 88. I thought that if I gave my horizontal divider position: relative, and a height of 5, it would end up right below my header. Instead, it's ending up at the very top of the page, and I'm confused as to why.

Alternative solution to null layout manager when absolute positioning is needed

橙三吉。 提交于 2019-12-01 21:39:59
Few months ago i read this Swing tutorial http://zetcode.com/tutorials/javaswingtutorial/resizablecomponent/ for understanding how implementing resizable components inside Swing. The tutorial tells about using a null LayoutManager in order to have the possibility of absolute positioning child components. In a discussion relative to another subject @Andrew Thompson pointed out that using null layout is a bad idea. This article http://download.oracle.com/javase/tutorial/uiswing/layout/none.html describe null layout manager as not desirable too, anyway it says that in certain situations the might

Relative and absolute positioning confusion

痴心易碎 提交于 2019-12-01 20:52:33
I'm new to html/css and I've just started wrapping my head around positioning but I seem to have a misunderstanding. Right now I'm trying to create a page header with a horizontal divider right below it. My header is positioned absolutely, with a top and left value of 0, and a height of 88. I thought that if I gave my horizontal divider position: relative, and a height of 5, it would end up right below my header. Instead, it's ending up at the very top of the page, and I'm confused as to why. I would like to use this horizontal divider again on my page, right above my footer, so I don't want

position:fixed in Windows Phone 7

半世苍凉 提交于 2019-12-01 20:16:14
问题 I'm trying to create a PhoneGap Windows Phone 7 application. In order to imitate an Application bar that should always be visible at the left side of the screen in landscape orientation, I wanted to place a <div> with CSS as position:fixed . This does not work, however, because the IE on WP7 seems not to support it. Does anyone have an idea how I can display such an Application bar without having position:fixed available? Thanks in advance 回答1: I was also hanging on this problem. It really

position:fixed in Windows Phone 7

不羁岁月 提交于 2019-12-01 18:07:37
I'm trying to create a PhoneGap Windows Phone 7 application. In order to imitate an Application bar that should always be visible at the left side of the screen in landscape orientation, I wanted to place a <div> with CSS as position:fixed . This does not work, however, because the IE on WP7 seems not to support it. Does anyone have an idea how I can display such an Application bar without having position:fixed available? Thanks in advance I was also hanging on this problem. It really seems not to be possible to create a fixed element and to position elements after every scroll looks even

Use full width excluding overflow scrollbar with “position: absolute”

蹲街弑〆低调 提交于 2019-12-01 17:27:58
I would like to have a small red div with full width at a fixed top position, inside another div that has overflow: scroll . I hope the jsFiddle makes it clear: http://jsfiddle.net/mCYLm/2/ . The issue is that the red div is overlapping the scrollbar. I guess right: 0 means the right hand side of div.wrapper ; it does not subtract the scrollbar of div.main . When I move the overflow: scroll into div.wrapper , then the red banner has the right size ( fiddle ). However, it is not at a fixed position anymore (scrolling down makes the banner scroll up). How can I achieve the following two things

If you specify `bottom: 0` for position: sticky, why is it doing something different from the specs?

一笑奈何 提交于 2019-12-01 17:08:14
This is a question when I read an article on the MDN position property . I thought that there was a clear difference between the behavior of sticky described there and the actual behavior. According to the MDN, fixed position elements are treated as relative position elements until the specified threshold is exceeded, and when the threshold is exceeded, they are treated as fixed position elements until the boundary of the parent element is reached ( Link ). Sticky positioning can be thought of as a hybrid of relative and fixed positioning. A stickily positioned element is treated as relatively