1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Making background image fit on different screen resolutions.

Discussion in 'CSS' started by Aeallanunya, Apr 22, 2008.

  1. #1
    I am tying to get the background image on my forum to fit properly on different screen resolutions and it can't be tiled or it will look really weird. I have the regular forum sitting right on top and at 1280 x 1024 the background image sits nicely behind it. But my other computer has a smaller monitor and the resolution is set at 1024 x 768 and the image is too large and the right side is cut off. Is there a way to fix this so it fits on more than one resolution?

    I am not very experienced with php code or where to put what in stylesheets, etc., so any assistance with details would be much appreciated. However I did find the part where the background image information is.

    Here is that part:

    
    /* The main body of the entire forum. */
    body {
        background-image: url(./images/img/panthergraphite.jpg);
        background-attachment: fixed;
        padding: 0 0 0 0;
        margin: 0;
    }
    
    
    Code (markup):
    Here is the entire stylesheet:

    
    /* Normal, standard links. */
    a:link
    {
       color: #2e2e2e;
       text-decoration: none;
    }
    a:visited
    {
       color: #27408B;
       text-decoration: none;
    }
    a:hover
    {
       color: #B22222;
       text-decoration: underline;
    }
    /* Navigation links - for the link tree. */
    .nav, .nav:link, .nav:visited
    {
       color: #ccc;
       text-decoration: none;
    }
    a.nav:hover
    {
       color: #FEFEFE;
       text-decoration: underline;
    }
    /* pathway nav */
    .pathway_box {
       margin:0;
       padding:0 15px 15px;
    }
    span.pathway_intro {
       color:#000;
       margin:0;
    }
    span.pathway {
       color: #000000;
       margin:0 15px 0 0;
    }
    /* Tables should show empty cells. */
    table
    {
       empty-cells: show;
    }
    /* By default (td, body..) use verdana in black. */
    body, td, th , tr
    {
       color: #000000;
       font-size: small;
       font-family: verdana, sans-serif;
       line-height: 130%;
    }
    /* The main body of the entire forum. */
    body {
        background-image: url(./images/img/panthergraphite.jpg);
        background-attachment: fixed;
        padding: 0 0 0 0;
        margin: 0;
    }
    /* Input boxes - just a bit smaller than normal so they align well. */
    input, textarea, button
    {
       color: #000000;
       background: url(./images/winbg.gif) #F2F2F2 repeat-x;
       font-family: verdana, sans-serif;
    }
    input, button
    {
       color: #000000;
       background: url(./images/winbg.gif) #f2f2f2 repeat-x;
       font-size: 90%;
    }
    textarea
    {
       font-size: 100%;
       color: #000000;
       background: url(images/winbg.gif) #f2f2f2 repeat-x;
       font-family: verdana, sans-serif;
    }
    /* All input elements that are checkboxes or radio buttons. */
    input.check
    {
    }
    /* Selects are a bit smaller, because it makes them look even better 8). */
    select
    {
       font-size: 90%;
       font-weight: normal;
       color: #000000;
       background: url(images/winbg.gif) #f2f2f2 repeat-x;
       font-family: verdana, sans-serif;
    }
    /* Standard horizontal rule.. ([hr], etc.) */
    hr, .hrcolor
    {
       height: 1px;
       border: 0;
       color: #666666;
       background-color: #d0cece;
    }
    a img
    {
       border: 0;
    }
    /* A quote, perhaps from another post. */
    .quote
    {
       color: #000000;
       background-color: #D7DAEC;
       border: 1px solid #000000;
       margin: 1px;
       padding: 1px;
       font-size: x-small;
       line-height: 1.4em;
    }
    
    /* A code block - maybe even PHP ;). */
    .code
    {
       color: #000000;
       background-color: #dddddd;
       font-family: "courier new", "times new roman", monospace;
       font-size: x-small;
       line-height: 1.3em;
       /* Put a nice border around it. */
       border: 1px solid #000000;
       margin: 1px auto 1px auto;
       padding: 1px;
       width: 99%;
       /* Don't wrap its contents, and show scrollbars. */
       white-space: nowrap;
       overflow: auto;
       /* Stop after about 24 lines, and just show a scrollbar. */
       max-height: 24em;
    }
    
    /* The "Quote:" and "Code:" header parts... */
    .quoteheader, .codeheader
    {
       color: #000000;
       text-decoration: none;
       font-style: normal;
       font-weight: bold;
       font-size: x-small;
       line-height: 1.2em;
    }
    /* Generally, those [?] icons.  This makes your cursor a help icon. */
    
    .help {
        cursor: help;
    }
    /* /me uses this a lot. (emote, try typing /me in a post.) */
    
    .meaction {
        color: #FF0000;
    }
    /* The main post box - this makes it as wide as possible. */
    
    .editor {
        width: 96%;
    }
    /* Highlighted text - such as search results. */
    
    .highlight {
        background-color: #FFF000;
        font-weight: bold;
        color: #000000;
    }
    /* Alternating backgrounds for posts, and several other sections of the forum. */
    .windowbg, tr.windowbg td
    {
       color: #000000;
       background: url(images/winbg2.gif) #ffffff top right repeat-y;
       border-bottom: 1px solid #dbdada;
       border-right: 1px solid #dbdada;
       border-left: 1px solid #FFFFFF;
       border-top: 1px solid #FFFFFF;
       padding: 5px;
    }
    .windowbg2, tr.windowbg2 td
    {
       color: #000000;
       background: url(images/winbg.gif) #f2f2f2 repeat-x;
       border-bottom: 1px solid #dbdada;
       border-right: 1px solid #dbdada;
       border-left: 1px solid #FFFFFF;
       border-top: 1px solid #FFFFFF;
       padding: 5px;
    }
    .windowbg3, tr.windowbg3 td
    {
       color: #000000;
       background: url(images/winbg.gif) #f2f2f2 repeat-x;
       padding: 5px;
    }
    td.windowbg img, td.windowbg2 img, td.windowbg3 img
    { 
       margin-right: 1ex;
    }
    /* the today container in calendar */
    .calendar_today
    {
       font-weight: bolder;
       text-align: center;
       background-color: #FCFCFC;
    }
    /* These are used primarily for titles, but also for headers (the row that says what everything in the table is.) */
    .titlebg, tr.titlebg th, tr.titlebg td, .titlebg2, tr.titlebg2 th, tr.titlebg2 td
    {
       color: #FFFFFF; font-style: normal; background: #3c4b56; padding-left: 10px; padding-right: 10px;
    }
    .titlebg, .titlebg a:link, .titlebg a:visited
    {
       font-weight: bold;
       color: #FFFFFF;
       font-style: normal;
    }
    .titlebg a:hover
    {
       color: #FFFFFF;
    }
    /* same as titlebg, but used where bold text is not needed */
    .titlebg2 a:link, .titlebg2 a:visited
    {
       color: #FFFFFF;
       font-style: normal;
       text-decoration: underline;
    }
    .titlebg2 a:hover
    {
       text-decoration: underline;
    }
    /* This is used for categories, page indexes, and several other areas in the forum.
    .catbg and .catbg2 is for boardindex, while .catbg3 is for messageindex and display headers*/
    .catbg , tr.catbg td , .catbg3 , tr.catbg3 td
    {
       background:  #46494c;
       color: #FFFFFF;
       padding-left: 10px;
       padding-right: 10px;
    }
    .catbg2 , tr.catbg2 td
    {
       background: #46494c;
       color: #FFFFFF;
       padding-left: 10px;
       padding-right: 10px;
    }
    .catbg, .catbg2, .catbg3
    {
    }
    .catbg, .catbg2
    {
       font-weight: bold;
    }
    .catbg3, tr.catbg3 td, .catbg3 a:link, .catbg3 a:visited
    {
       font-size: 95%;
       color: #FFFFFF;
       text-decoration: none;
    }
    .catbg a:link, .catbg a:visited , .catbg2 a:link, .catbg2 a:visited
    {
       color: #FFFFFF;
       text-decoration: none;
    }
    .catbg a:hover, .catbg2 a:hover, .catbg3 a:hover
    {
       color: #5BBEC9;
    }
    /* This is used for tables that have a grid/border background color (such as the topic listing.) */
    .bordercolor
    {
       background-color: #DEDDDD;
       padding: 0px;
    }
    /* This is used on tables that should just have a border around them. */
    .tborder
    {
    }
    /* Default font sizes: small (8pt), normal (10pt), and large (14pt). */
    .smalltext
    {
       font-size: x-small;
       font-family: verdana, sans-serif;
    }
    .middletext
    {
       font-size: 90%;
    }
    .normaltext
    {
       font-size: small;
    }
    .largetext
    {
       font-size: large;
    }
    /* Posts and personal messages displayed throughout the forum. */
    
    .post, .personalmessage {
        width: 100%;
        overflow: auto;
        line-height: 1.3em;
    }
    /* All the signatures used in the forum.  If your forum users use Mozilla, Opera, or Safari, you might add max-height here ;). */
    
    .signature {
        width: 100%;
        overflow: auto;
        padding-bottom: 3px;
        line-height: 1.3em;
    }
    /* Sometimes there will be an error when you post */
    .error {
        color: #FF0000;
    }
    /* definitions for the main tab, active means the tab reflects which page is displayed */
    
    .maintab_first, .maintab_back, .maintab_last, .maintab_active_first, .maintab_active_back, .maintab_active_last{   vertical-align:top}
    .maintab_back, .maintab_active_back{   text-decoration:none;    font-size: 9px;    vertical-align:top;    padding:2px 6px 6px 6px;    font-family:verdana,tahoma,sans-serif}
    .maintab_first{}
    .maintab_back{   background:url(./images/img/menubg.gif) repeat-x #f0f0f0}
    .maintab_last{}
    .maintab_active_first{}
    .maintab_active_back{   font-weight:bold;    background:url(./images/img/menubg.gif) repeat-x #f0f0f0;  color: #FFF}
    .maintab_active_last{}
    .maintab_back a:link, .maintab_back a:visited, .maintab_active_back a:link, .maintab_active_back a:visited{ text-decoration:none;  color: #FFF}
    .maintab_active_back a:link, .maintab_active_back a:visited{ color:#ffe8a0}
    .maintab_back a:hover, .maintab_active_back a:hover{ text-decoration:underline}
    
    .mirrortab_first, .mirrortab_back, .mirrortab_last, .mirrortab_active_first, .mirrortab_active_back, .mirrortab_active_last{   vertical-align:top}
    .mirrortab_back, .mirrortab_active_back{   text-decoration:none;    font-size:9px;    vertical-align:bottom;    padding:6px;    font-family:verdana,tahoma,sans-serif}
    .mirrortab_first{}
    .mirrortab_back{   background:url(./images/img/menubg.gif) repeat-x #f0f0f0}
    .mirrortab_last{}
    .mirrortab_active_first{}
    .mirrortab_active_back{   font-weight:bold;    background:url(./images/img/menubg.gif) repeat-x #f0f0f0}
    .mirrortab_active_last{}
    .mirrortab_back a:link, .mirrortab_back a:visited, .mirrortab_active_back a:link, .mirrortab_active_back a:visited{ text-decoration:none;  color: #FFF}
    .mirrortab_back a:hover, .mirrortab_active_back a:hover{ text-decoration:underline}
    /* The AJAX notifier */
    #ajax_in_progress {
        background: #32CD32;
        color: white;
        text-align: center;
        font-weight: bold;
        font-size: 18pt;
        padding: 3px;
        width: 100%;
        position: fixed;
        top: 0;
       left: 0;
    }
    #widthControl {
        width: 70%;
        min-width: 720px;
        margin: 0 auto;
        padding: 0;
    }
    #header {
        position: relative;
        height: 200px;
        overflow: hidden;
        background: url(./images/img/topbg.gif) 0 0 repeat-x;
    }
    #logo {
        position: absolute;
        top: 40px;
        left: 30px;
        display: block;
        width: 555px;
        height: 170px;
        cursor: pointer;
        background: url(./images/slogan.gif) no-repeat;
     }
    #userarea {
        height: 73px;
        float: right;
        padding: 30px 25px 0 0;
        text-align: left;
        font-size: 1.0em;
        color: #fff;
        font-family: Trebuchet MS; 
    }
    #userarea a:link, #userarea a:visited {
        color: #ffffee;
    }
    #userarea a:hover {
        color: #eee;
        text-decoration: underline;
    }
    #search {
        float: right;
        padding: 50px 25px 0 0;
        margin: 0;
        clear: both;
    }
    .inputs { 
       color: #FFFFFF;
       font-weight: 700;
       border: 3px solid #454545;
       background: #5D7183;
       text-indent: 0.2cm;
    }
    .inputs:hover {
       border: 3px solid #FFFFFE;
    }
    /* The template menu */
    #tab
    {
       width:100%;
       height:51px;
       background: #FFFFFF url(./images/img/bmid_028.gif);
       margin:0;
       border:0;
    }
    #tab 
    {
       margin:0 0 0 0;
       top:0;
    }
    #tab ul 
    {
       margin:0;
       padding:0;
       list-style:none;
       float:left;
    }
    #tab li 
    {
    display:inline;
       float:left;
       margin:0 0 0 0 ;
       padding:0;
    }
    #tab a 
    {
       background:#000 url(./images/img/bright_028.gif) no-repeat right top;
       margin:0;
       padding:0;
       text-decoration:none;
       border:0;
       display:block;
       float:left;
    }
    #tab a span 
    {
       display:block;
       background:url(./images/img/bleft_028.gif) no-repeat left top;
       padding:0 18px 0 16px;
       font-family:Arial, Helvetica, sans-serif;
       font-size:11;
       color:#FFFFFF;
       font-weight:bold;
       line-height:51px;
    }
    #tab a:hover,#tab li.chosen a 
    {
       background-position:right bottom;
       border-color:#000000;
    }
    #tab a:hover span,#tab li.chosen a span 
    {
       background-position:left bottom;
       color:#FFFFFF;
       font-weight:bold;
       font-style: normal;
       text-decoration:none;
    }
    #mainarea {
        padding: 10px;
        margin: 0;
        background: #F6F6F6 url(images/img/repeat.gif) 0 0 repeat-x;
    }
    
    #footer a:link, #footer a:visited {
        color: #fafafa;
    }
    #footer a:hover {
        color: #FFF;
        text-decoration: none;
        border-bottom: 1px dotted #ccc;
    }
    #footer {
       clear: both;
       width: auto 0;
       height: 90px;
       background: #3E5D7C url(images/img/botbg.gif) repeat-x;
       padding: 10px 0;
       margin: 0;
       line-height: 13px;
       text-align: center;
       font-weight: normal;
       color: #fff;
       padding: 2px 0;
       font-size: 12px;
       font-family: Verdana;
    }
    #footer a {
       color: #CBEAFA;
    }
    #footer a:hover {
       color: #CBEAFA;
       text-decoration: underline;
    }
    Code (markup):

     
    Aeallanunya, Apr 22, 2008 IP
  2. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can't stretch background images with CSS. Either tile the image (even if it means replacing it), or design the layout around the image.

    What does this image look like anyway?
     
    Dan Schulz, Apr 23, 2008 IP
  3. Aeallanunya

    Aeallanunya Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I can't show you yet because I can't post links to images in photobucket.
     
    Aeallanunya, Apr 25, 2008 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can post the link, but it won't be active. It'll just appear as plain text that I can copy/paste into my browser's address bar.
     
    Dan Schulz, Apr 25, 2008 IP
  5. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #5
    Which sucks. I was hoping IE8 would implement it, so then we would have Safari + IE support it, and Opera and Firefox would follow suit. It is one of those CSS3 things I'd like to see around soon. But IE9 will be years off....
     
    blueparukia, Apr 26, 2008 IP
  6. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I don't think IE 9 will be years off, actually. Microsoft's apparently in a fight for its life without actually admitting it. Don't expect to wait another 6 years for another browser update once IE 8 is released.
     
    Dan Schulz, Apr 26, 2008 IP