...

View Full Version : background problem.



bazz
10-29-2008, 03:22 AM
Hi,

When I put the background css into the head of my page, the background image fails to show beneath the bottom of the viewport as if it was set to 100%. There is nothing setting the body/html to be 100%.

If I put the same css into the external stylesheet, it works fine. Presumably I am doing something wrong but can any of you help me find it please.

You may suggest that I put it into the external sheet then. However I need the url to be made dynamically and I don't think an external sheet can do that.

external css


* {
margin:0;
padding:0;
}

html,body {
background: #444 url(http://example.com/images/bg.gif ) repeat;
font-family:Geneva, Arial, Verdana, Helvetica, sans-serif;
color:#40231D;
}


the head css


html,body {
background: #444 url(http://example.com/images/bg.gif) repeat;
font-family:Geneva, Arial, Verdana, Helvetica, sans-serif;
color:#40231D;
}


bazz

twodayslate
10-29-2008, 03:52 AM
Do you have a live preview?

html is 100% all the time

bazz
10-29-2008, 04:12 AM
Thanks for the reply. I have pm'd you because I can't put the url live on a public forum yet. I can send it to anyone I 'know' if you would like to help.

bazz

oesxyl
10-29-2008, 04:44 AM
hi,
i you put this in the head seaction:


html,body {
background: #444 url(http://example.com/images/bg.gif) repeat;
font-family:Geneva, Arial, Verdana, Helvetica, sans-serif;
color:#40231D;
}

when browser parse the style block, it already finish to read the html start tag and what is before this block in the head section of the page and then will ignore css declaration.



<html>
<head>
.....
<style type="text/css">
html,body { ....

if you remove html will probably work.

best regards

bazz
10-29-2008, 04:47 AM
Thanks oesxyl but, even with this, it doesn't work any better.



<style type="text/css">
body {
background: #444 url(http://example.com/images/bg.gif) repeat;
}
</style>



bazz

twodayslate
10-29-2008, 04:57 AM
when I changed
html, body to just body it worked for me.
;)

bazz
10-29-2008, 05:11 AM
:eek: :confused:

Well, if I copy the html output from the perl file, and make it a static page, the background-image runs all the way. But if I loook at the perl output throguh the browser the image stops at the bottom of the screen.

I don't understand because the two outputs/codes are the same.

Thank you twodayslate. (you were early this time :D )

bazz

twodayslate
10-29-2008, 05:16 AM
:eek: :confused:

Well, if I copy the html output from the perl file, and make it a static page, the background-image runs all the way. But if I loook at the perl output throguh the browser the image stops at the bottom of the screen.

I don't understand because the two outputs/codes are the same.

Thank you twodayslate. (you were early this time :D )

bazz
np
yeah, always check the pages in the actually browser. it doesn't take that much extra work.
GL on your site.

oesxyl
10-29-2008, 05:18 AM
:eek: :confused:

Well, if I copy the html output from the perl file, and make it a static page, the background-image runs all the way. But if I loook at the perl output throguh the browser the image stops at the bottom of the screen.

I don't understand because the two outputs/codes are the same.

Thank you twodayslate. (you were early this time :D )

bazz
remove or set to transparent the background-color from ids container and textfiels because hide the backround.

best regards

bazz
10-29-2008, 05:37 AM
Thanks oesxyl.

I have it now though only temporarily. I have had to use an absolute url in the external css file instead of making a dynamic link for the image. I'll try to think it through further.

bazz

oesxyl
10-29-2008, 05:50 AM
Thanks oesxyl.

I have it now though only temporarily. I have had to use an absolute url in the external css file instead of making a dynamic link for the image. I'll try to think it through further.

bazz
I use something like this in perl:


my $cg = CGI->new;
print $cg->header,
$cg->start_html(-xbase => 'http://sub.dom.com/',
-style => 'relativ path',
-script => { -type => 'text/javascript',
-src => 'also relative'});


best regards

bazz
10-29-2008, 06:16 AM
Thanks oesxyl.

I'll look into that tomorrow.

bazz



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum