You are here: Re: Sizing Page Backgrounds « HTML « IT news, forums, messages
Re: Sizing Page Backgrounds

Posted by Peterken on 11/08/32 11:34

> "Jonathan N. Little" <lws4art@centralva.net> wrote in message
> news:439cb8dd$0$8168$cb0e7fc6@news.centralva.net...
>> PJB wrote:
>>> Is there a way to define the size of a page's background image
>>> so it spans 100% of any screen?
>> <snip>
>>
>> Another way to fake it with CSS, here assuming background image very dark
>>
>> <style type="text/css">
>> HTML, BODY {
>> width: 100% height: 100%; color: white; background-color: black; }
>> /* bg image only specify width so it will not distort when scaling */
>> #bg, #content { position: absolute; width: 100%; }
>> #content {height: 100% }
>> </style>
>>
>>
>> <body>
>> <img id="bg" src="YourBackgroundImage.jpg" alt="">
>> <div id="content">
>> <p>Put your page content here...</p>
>> </div>
>> </body>
>>
>>
>> --
>> Take care,
>>
>> Jonathan
>> -------------------
>> LITTLE WORKS STUDIO
>> http://www.LittleWorksStudio.com
>
>
"PJB" <pjb2@canadaSTOPSPAM.com> wrote in message
news:z4udnY6JgeivfwDenZ2dnUVZ_v-dnZ2d@rogers.com...
> Thanks you for all the suggestions.
>
> I successfully applied Jonathan's suggestion to my Index page
> (see www.pjbird.com). The picture re-sizes nicely at different resolutions
> and aspect ratios and does not loose quality. Thanks for that!
>
> Inevitably, page elements will appear in different locations depending on
> the resolution and aspect ratio. This is to be expected and I will have to
> play around a bit.
>
> PJB
>
>


Nice trick, but what if PJB's pages' contents is alot larger then the
background image ?

In other words:
Is it possible using Jonathans CSS to have a "pseudo-fixed" background image
(and
resized in the way PJB wanted)
AND
having the body scroll over it, thus a simulation of retaining the image
ever in the viewport ?
(ok, I admit, maybe a bit of a silly question, but I'm rather new to CSS so
forgive me....)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация