css :: position
2 отговора
100 прегледа
css :: position
Интересува ме има ли начин да накарам една картинка да стои статично спрямо екрана (не спрямо документа). Единият вариант е да я сложа за background на body-то и position: fixed, но работата е там, че вече имам такава картинка, а както е известно, не мога да имам 2 такива.
Сещам се за разни JS detect-ове, което да следят ако се scroll-не да я премества, но на мен ми трябва нещо наистина static.
Може би не съм достатъчно ясен...искам да укажа на картинката да стои примерно на: left: 0; top: 0 - но дори и при скролване на страницата надолу, тя да си остане на 0, 0, а не да изчезва нагоре.
"Никоя армия не може да спре идея, чието време е дошло." - Виктор Юго
Сещам се за разни JS detect-ове, което да следят ако се scroll-не да я премества, но на мен ми трябва нещо наистина static.
Може би не съм достатъчно ясен...искам да укажа на картинката да стои примерно на: left: 0; top: 0 - но дори и при скролване на страницата надолу, тя да си остане на 0, 0, а не да изчезва нагоре.
"Никоя армия не може да спре идея, чието време е дошло." - Виктор Юго
Редактирано от Dakota на
Re: css :: position
Viz tuk - [линк]
Ima samo edin problem - ne se poddyrza ot IE (baja problem, a ;-)
Za demo viz [линк] - mnogo efektno, ama
taja prozrachnost napravo mi izjade CPU-to.
--
What's worse - ignorance or indifference? Who knows? Who cares?
Ima samo edin problem - ne se poddyrza ot IE (baja problem, a ;-)
Za demo viz [линк] - mnogo efektno, ama
taja prozrachnost napravo mi izjade CPU-to.
--
What's worse - ignorance or indifference? Who knows? Who cares?
Re: css :: position
Po princip w CSS2 specificaciata ima takyw positioning ... obache ne se poddyrja ot IE. Drugia nachin e sys static frames .... Obshto wzeto taia rabota ne stawa taka kakto ti ia iskash ;)
Eto izwadkla ot CSS2 spec:
Choosing a positioning scheme: 'position' property
...
fixed
The box's position is calculated according to the 'absolute' model, but in addition, the box is fixed with respect to some reference. In the case of continuous media, the box is fixed with respect to the viewport (and doesn't move when scrolled). In the case of paged media, the box is fixed with respect to the page, even if that page is seen through a viewport (in the case of a print-preview, for example). Authors may wish to specify 'fixed' in a media-dependent way. For instance, an author may want a box to remain at the top of the viewport on the screen, but not at the top of each printed page. The two specifications may be separated by using an @media rule, as in:
Example(s):
@media screen {
H1#first { position: fixed }
}
@media print {
H1#first { position: static }
}
Krai na citat
t.e. sys position:fixed mojesh da fiksirash tochno polojenieto na obekta spriamo viewport-a t.e. prozoreca na browsera.
Cheers
Eto izwadkla ot CSS2 spec:
Choosing a positioning scheme: 'position' property
...
fixed
The box's position is calculated according to the 'absolute' model, but in addition, the box is fixed with respect to some reference. In the case of continuous media, the box is fixed with respect to the viewport (and doesn't move when scrolled). In the case of paged media, the box is fixed with respect to the page, even if that page is seen through a viewport (in the case of a print-preview, for example). Authors may wish to specify 'fixed' in a media-dependent way. For instance, an author may want a box to remain at the top of the viewport on the screen, but not at the top of each printed page. The two specifications may be separated by using an @media rule, as in:
Example(s):
@media screen {
H1#first { position: fixed }
}
@media print {
H1#first { position: static }
}
Krai na citat
t.e. sys position:fixed mojesh da fiksirash tochno polojenieto na obekta spriamo viewport-a t.e. prozoreca na browsera.
Cheers