Questions tagged [position]

Position refers to the location of an element relative to its container, typically on the horizontal and vertical axes.

In computing, position closely relates to the geometrical definition of a position or position vector, also known as location vector or radius vector, which is a Euclidean vector that represents the position of a point P in space in relation to an arbitrary reference origin O. Usually denoted x, r or s, it corresponds to the displacement from O to P.

In simplified terms, position is used in reference to the location of a 'child' entity within a two-dimensional or three-dimensional space, the boundaries of which are referred to as the 'container' or 'parent'.

9210 questions
57
votes
3 answers

Getting selected text position

Currently I'm getting the selected text in the browser doing this: window.getSelection(); Now I need to show a tooltip above that text when pressing a custom key(note that the mouse could not be over the text anymore), so in order to do that I need…
Ecarrion
  • 4,940
  • 1
  • 33
  • 44
57
votes
11 answers

How do I stop my fixed navigation from moving like this when the virtual keyboard opens in Mobile Safari?

I understand that mobile safari has a lot of bugs around fixed elements, but for the most part I've managed to get my layout working correctly until I added a much needed text input to the fixed navigation at the bottom. Now when the user focuses on…
Eric
  • 2,004
  • 6
  • 23
  • 33
57
votes
3 answers

Is there any way for "position:absolute" div to retain relative width?

Let's say I have two divs, one inside the other, like so:
Right now, the inner div has a width of 100% of 50%…
Charles
  • 4,372
  • 9
  • 41
  • 80
57
votes
8 answers

Get max and min value from array in JavaScript

I am creating the following array from data attributes and I need to be able to grab the highest and lowest value from it so I can pass it to another function later on. var allProducts = $(products).children("li"); prices =…
RJB
  • 669
  • 1
  • 8
  • 13
55
votes
4 answers

css "fixed" child element positions relative to parent element not to the viewport, why?

I'm developing a wordpress theme, with an isotope grid and where a hover on a post should display its title with a fixed position on the bottom of the browser. I have this simplified structure:
R4ttlesnake
  • 1,661
  • 3
  • 18
  • 28
54
votes
9 answers

Set window position of an application on Windows command line

I have an application which starts at position 0x0 of my desktop. I want to open it in the center of my desktop. I do not want to open it and use a move command to move it into center, instead my app should start immediately at center position. Is…
Inside Man
  • 4,194
  • 12
  • 59
  • 119
52
votes
14 answers

position:sticky is not working

I have this HTML code:
Description
.header has a height of 150px. .navbar has a height of 20px. When the user scrolls, I want…
Wolfuryo
  • 736
  • 1
  • 7
  • 12
51
votes
10 answers

Set position absolute and margin

I would like to set an element's position to absolute and have a margin-bottom, but it seems that the margin-bottom doesn't have an effect. HTML:
CSS: #container { border: 1px solid red; position: absolute; top:…
kirby
  • 3,981
  • 14
  • 41
  • 54
51
votes
2 answers

Find the distance between HTML element and browser (or window) sides

How to find the distance in pixels between html element and one of the browser (or window) sides (left or top) using jQuery?
Kai
  • 2,023
  • 7
  • 28
  • 49
49
votes
2 answers

Browser developer tools: what is the Position of the HTML element?

Modern Web Developer tools (in Chrome / FF / IE, eg.) provide a way to see the "Box Model" and "Computed CSS Properties" of a particular element. However; Is there a way to monitor the final computed/layout position easily with such…
user2864740
  • 60,010
  • 15
  • 145
  • 220
49
votes
1 answer

What are the CSS properties that get elements out of the normal flow?

What are the CSS properties that get elements out of the normal flow? Such properties would be float, position:absolute etc. This question relates to all the possible alterations of the normal flow.
andreihondrari
  • 5,743
  • 5
  • 30
  • 59
49
votes
10 answers

CSS position element "fixed" inside scrolling container

i wonder if anyone has found a solution for this? i am looking for a solution to attach an element to the top of a scrolling container HTML:
title
......
... (about…
Siggi Gross
  • 491
  • 1
  • 4
  • 4
48
votes
5 answers

CSS Positioned Absolute Element, automatic width outside of parent's bounds?

So, I have my parent element positioned relative, in order to allow a tooltip element to be positioned absolute inside, at the top of it. I am aware that you are required to add "left: 0, right: 0", so that the width of the element is still able to…
Danny
  • 579
  • 2
  • 7
  • 13
45
votes
7 answers

How do I automatically stack divs vertically inside a parent?

Here's what I am trying to accomplish... "parent" has position:relative "div 1-3" have position:absolute However, whenever I do this, I find myself having to assign specific "top" values in my CSS. So div 1 might be top:50px, div 2 would be…
Fingeldor
  • 465
  • 1
  • 5
  • 8
42
votes
1 answer

click link below a higher z-index div

Possible Duplicate: Passing mouse clicks through an overlaying element
Is it possible to click the link below the red square without javascript? The red div doesn't need to be clickable. http://jsfiddle.net/efortis/LNwHV/ #bottom{ width:…
Eric Fortis
  • 16,372
  • 6
  • 41
  • 62