0

I want to style a fixed position element for the edge of the website (a div) and not the edge of the screen.

However on large resolutions what I currently see is a large gap between the the fixed element and the website. On small sites I see the fixed width elements are pushed in too close together.

How can I do that?

Multiple css for different screen resolutions?

Any generic solution available?

Thanks,

Mat

Mat Kay
  • 508
  • 1
  • 11
  • 24
  • 1
    Not sure about your particular application, but [a previous answer of mine](http://stackoverflow.com/questions/3303173/position-element-fixed-vertically-absolute-horizontally/3303944#3303944) might be what you are looking for. – ScottS May 15 '12 at 01:51
  • I was looking at that solution. I didn't think a fixed element could be made relative to an absolute element? It seems like the fixed gets some positioning from the absolute div. – Mat Kay May 15 '12 at 02:03
  • I didn't think so either, until in experimenting for a solution to that answer I realized that as long as a `right` or `left` was not set, it sits where it was initially placed, and can then be moved by margin in relation to that wrapper. This may work for your application as well. – ScottS May 15 '12 at 02:19
  • Also note, it can be set not just to an `absolute` element but also a `relative` one (if you read the explanation I give). Not sure that I tried a `static` element. – ScottS May 15 '12 at 02:25
  • First time I've realised that a fixed element is still relative to its parent but then fixed to the screen afterwards. http://stackoverflow.com/a/1384650/1070340 – Mat Kay May 15 '12 at 02:47

0 Answers0