Absolute positioned layout issue on smaller screens

NielsPilon

I'm working on a really small splash page that only has two links and a large centered background with some centered text. The text is also part of the image. The links are absolute positioned in a relative positioned container.

The links are positioned fine on screens larger than 1024px which is the size of the container. As soon as the screen gets smaller the position of the links are not in the right place anymore. This because they are related to the container and not the browser window.

This site shouldn't be responsive but it would be nice if the links are still positioned in the right place even when the window gets smaller. Is this even possible or is my current approach not the tight one?

You can see the page at the following link: http://nionwebdesign.com/dev/physical The links on the page are the Facebook link and the logo right at the bottom.

The current markup:

<!DOCTYPE html>
<html>
<head>      
</head>
<body>

<div class="container">

<a class="facebook" href="#"><img src="img/facebook.png"></a>
<a class="logo" href="#"><img src="img/logo-intime.png"></a>

</div>
</body>
</html>

The current css:

body{
background: #000 url('img/bg-leeg.jpg') no-repeat center top;
min-height: 900px;
}

.container{
width: 1024px;
margin: 0 auto;
position: relative;
}

.facebook{
position: absolute;
top: 628px;
right: 62px;
}

.logo{
position: absolute;
top: 778px;
right: 20px;
 }
Gust van de Wal

The links to Facebook and the logo can be placed outside the container. Like that, they don't depend on the container's position (which can't be always in the middle) the way you set it up.

I've placed the links outside the container (before or after doesn't matter), then given them new positions (don't worry, they are exacly the same, just recalculated!)

My code:

HTML

<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
    <div class="container"></div>
    <a class="facebook" href="#"><img src="img/facebook.png"></a>
    <a class="logo" href="#"><img src="img/logo-intime.png"></a>
  </body>
</html>

CSS

body{
    background: #000 url('img/bg-leeg.jpg') no-repeat center top;
    min-height: 900px;
}

.container{
    width: 1024px;
    margin: 0 auto;
    position: relative;
}

.facebook{
    position: absolute;
    top: 628px;
    left: calc(50% + 192px);
}

.logo{
    position: absolute;
    top: 778px;
    left: calc(50% + 351px);
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Absolute positioned layout issue on smaller screens

From Dev

Positioning of div's using css: layout issue with absolute positioned div

From Dev

Absolute positioned nav arrow issue

From Dev

fixed positioned banner - responsive issue on smaller devices

From Dev

"Absolute Positioned" Item shifting layout vertically

From Dev

Layout resizing issue for different screens

From Dev

Absolute positioned button in a flex layout with hidden overflow (with scolling)

From Dev

Reorder DIVs on smaller screens

From Dev

Sidebar is at bottom on smaller screens

From Dev

Centering an absolute positioned div

From Dev

centering absolute positioned items

From Dev

Chrome CSS issue with absolute positioned input elements inside of relative parents (Chrome 32.0.1700.77) right: 0 not working

From Dev

Chrome CSS issue with absolute positioned input elements inside of relative parents (Chrome 32.0.1700.77) right: 0 not working

From Dev

Responsive Image with CSS for smaller screens

From Dev

CSS resizing DIV on smaller screens

From Dev

Website not Displaying Properly on Smaller Screens

From Dev

Footer comes up in smaller screens

From Dev

Hiding background images on smaller screens

From Dev

Toggle navigation only on smaller screens

From Dev

jQuery Cycle layout issue - added inline style (position:absolute) causing issue with layout

From Dev

Absolute positioned element is not above other absolute positioned elements in Safari iOS

From Dev

Absolute positioned element is not above other absolute positioned elements in Safari iOS

From Dev

angularjs with absolute positioned elements in page

From Dev

absolute positioned element activating scroll

From Dev

Absolute positioned div with dynamic height

From Dev

Absolute positioned content overlapping footer

From Dev

Truncate text in an absolute positioned div

From Dev

How to center absolute positioned items

From Dev

absolute positioned div images overlapping

Related Related

  1. 1

    Absolute positioned layout issue on smaller screens

  2. 2

    Positioning of div's using css: layout issue with absolute positioned div

  3. 3

    Absolute positioned nav arrow issue

  4. 4

    fixed positioned banner - responsive issue on smaller devices

  5. 5

    "Absolute Positioned" Item shifting layout vertically

  6. 6

    Layout resizing issue for different screens

  7. 7

    Absolute positioned button in a flex layout with hidden overflow (with scolling)

  8. 8

    Reorder DIVs on smaller screens

  9. 9

    Sidebar is at bottom on smaller screens

  10. 10

    Centering an absolute positioned div

  11. 11

    centering absolute positioned items

  12. 12

    Chrome CSS issue with absolute positioned input elements inside of relative parents (Chrome 32.0.1700.77) right: 0 not working

  13. 13

    Chrome CSS issue with absolute positioned input elements inside of relative parents (Chrome 32.0.1700.77) right: 0 not working

  14. 14

    Responsive Image with CSS for smaller screens

  15. 15

    CSS resizing DIV on smaller screens

  16. 16

    Website not Displaying Properly on Smaller Screens

  17. 17

    Footer comes up in smaller screens

  18. 18

    Hiding background images on smaller screens

  19. 19

    Toggle navigation only on smaller screens

  20. 20

    jQuery Cycle layout issue - added inline style (position:absolute) causing issue with layout

  21. 21

    Absolute positioned element is not above other absolute positioned elements in Safari iOS

  22. 22

    Absolute positioned element is not above other absolute positioned elements in Safari iOS

  23. 23

    angularjs with absolute positioned elements in page

  24. 24

    absolute positioned element activating scroll

  25. 25

    Absolute positioned div with dynamic height

  26. 26

    Absolute positioned content overlapping footer

  27. 27

    Truncate text in an absolute positioned div

  28. 28

    How to center absolute positioned items

  29. 29

    absolute positioned div images overlapping

HotTag

Archive