Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts

    background problem.

    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
    Code:
    * {
    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
    Code:
     
    html,body {
    background: #444 url(http://example.com/images/bg.gif) repeat;
    font-family:Geneva, Arial, Verdana, Helvetica, sans-serif;
    color:#40231D;
    }
    bazz
    Last edited by bazz; 10-29-2008 at 02:44 AM.
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #2
    Senior Coder twodayslate's Avatar
    Join Date
    Mar 2007
    Location
    VA
    Posts
    1,042
    Thanks
    67
    Thanked 39 Times in 39 Posts
    Do you have a live preview?

    html is 100% all the time
    twitter | Quality Hosting - $5.95/mo*
    Feel free to PM me!

  • #3
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    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
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #4
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    hi,
    i you put this in the head seaction:
    Code:
     
    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.

    Code:
    <html>
      <head>
        .....
        <style type="text/css">
           html,body { ....
    if you remove html will probably work.

    best regards
    Last edited by oesxyl; 10-29-2008 at 03:48 AM.

  • #5
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    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
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #6
    Senior Coder twodayslate's Avatar
    Join Date
    Mar 2007
    Location
    VA
    Posts
    1,042
    Thanks
    67
    Thanked 39 Times in 39 Posts
    when I changed
    html, body to just body it worked for me.
    twitter | Quality Hosting - $5.95/mo*
    Feel free to PM me!

  • #7
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts


    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 )

    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #8
    Senior Coder twodayslate's Avatar
    Join Date
    Mar 2007
    Location
    VA
    Posts
    1,042
    Thanks
    67
    Thanked 39 Times in 39 Posts
    Quote Originally Posted by bazz View Post


    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 )

    bazz
    np
    yeah, always check the pages in the actually browser. it doesn't take that much extra work.
    GL on your site.
    twitter | Quality Hosting - $5.95/mo*
    Feel free to PM me!

  • #9
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by bazz View Post


    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 )

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

    best regards

  • #10
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    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
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #11
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by bazz View Post
    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:
    Code:
    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

  • #12
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    Thanks oesxyl.

    I'll look into that tomorrow.

    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •