Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Design and Graphics Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-21-2010, 08:34 AM
Chaos Residue Chaos Residue is offline
 
Join Date: Jul 2009
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Background Image Help

If this question has been asked before then I apologize. I have searched Google and this website and found nothing that answers it so far.

I have a background image for my website that is 1680px by 1050px. I want this background image to be a fixed image and I want it to automatically re-size depending on the users screen resolution. Is this possible? If so, what do I need to do to make this happen?

If someone needs an example of what I mean, use this as an example. If someone has their screen resolution set to 800x600 then I want them to see the background image as a 800x600 fixed background image. If they change their resolution to 1280x960 then I want them to see the background image as a 1280x960 fixed background image. If they then change their resolution to 1680x1050 I want them to see the background image as a 1680x1050 fixed background image.

Screen Resolution = 800x600
Image Size becomes 800x600

Screen Resolution = 1280x960
Image Size becomes 1280x960

Screen Resolution = 1680x1050
Image Size becomes 1680x1050
Reply With Quote
  #2  
Old 12-21-2010, 04:27 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You'll have to use some CSS - http://css.flepstudio.org/en/css-tip...und-image.html
Reply With Quote
  #3  
Old 12-23-2010, 06:28 AM
Chaos Residue Chaos Residue is offline
 
Join Date: Jul 2009
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What CSS file am I supposed to be editing? I edited vbulletin.css and changed it from the default:

Code:
background:{vb:stylevar doc_background};
to this:

Code:
background:{vb:stylevar doc_background};
           {position:absolute};
           {height:100%};
           {width: 100%};
           {margin:0};
           {padding: 0};
Nothing seemed to change. Did I edit the wrong code? Or did I just do it incorrectly?
Reply With Quote
  #4  
Old 12-23-2010, 02:54 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Chaos Residue View Post
What CSS file am I supposed to be editing? I edited vbulletin.css and changed it from the default:

Code:
background:{vb:stylevar doc_background};
to this:

Code:
background:{vb:stylevar doc_background};
           {position:absolute};
           {height:100%};
           {width: 100%};
           {margin:0};
           {padding: 0};
Nothing seemed to change. Did I edit the wrong code? Or did I just do it incorrectly?
You wrote it wrong. Did you look at the link I linked to on how to write the CSS? you can't use the stylevar doc_background and then go try to change the background property in the same declaration like that.
Reply With Quote
  #5  
Old 12-24-2010, 07:45 AM
Chaos Residue Chaos Residue is offline
 
Join Date: Jul 2009
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So I removed linking to stylevar doc_background completely. This is what I now have:

Code:
	background:url(http://www.undergroundgamers.net/forums/images/misc/ugbg.jpg);
                   position:absolute;
                   height:100%;
                   width:100%;
                   margin:0;
                   padding:0;
My background image is in a different position now, but still not like it should be. It's like the image is blown up to a larger size that's too big for the screen. My forum is set to a fixed width (950px). Any changes I make to the width and height in the above code affect the forum itself, not the size of the background image. I apologize if I sound stupid (which, no doubt, I do), I'm kind of new to the whole editing CSS and I'm trying to learn as I go along. If you want to see what I'm talking about here's the forum: http://www.undergroundgamers.net/forums/

--------------- Added [DATE]1293188964[/DATE] at [TIME]1293188964[/TIME] ---------------

Here's an update. I've ended up with this code:

Code:
html {
        height:100%
        width:100%
        margin:0;
        padding:0;
	background:url(http://www.undergroundgamers.net/forums/images/misc/ugbg.jpg) center center no-repeat;
	<vb:if condition="is_browser('opera') && $stylevar['textdirection'] == 'rtl'">
		overflow-x: hidden;
	</vb:if>
}
This looks correct on the Forums section of the vB4 Suite, but at the top of the Blog section you'll notice an extra white space, the CMS section has no background image whatsoever, and the What's New section looks like it did when I was still using stylevar doc_background. Also, the background image is not a fixed image this way. Sheesh, this is a lot of work for a background...
Reply With Quote
  #6  
Old 12-24-2010, 03:56 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You forgot the ; after the height and width properties in your CSS and you would probably want to use "center top", not "center center", but besides that, I think what you need to do is edit the templates and add that background as an image, like in the tutorial I linked you to. See their page here - http://www.onsitus.it/css-tutorials/sfondo-100-percent/ Isn't that what you want? Look at the page source - the background is an image tag added to the page.
Reply With Quote
  #7  
Old 05-15-2011, 04:55 PM
BLacK_WaRZ BLacK_WaRZ is offline
 
Join Date: Apr 2010
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A very old old thread but i have the same problem , can`t know what i should and i try to do what u saied but nothing happened > anyone can help?
Reply With Quote
  #8  
Old 05-15-2011, 05:14 PM
bela-meaad bela-meaad is offline
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

its better to open a new thread ^_^
Reply With Quote
  #9  
Old 05-15-2011, 05:16 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And we'll need a link to the style you have tried to implement the code in that tutorial.
Reply With Quote
  #10  
Old 05-16-2011, 10:42 AM
BLacK_WaRZ BLacK_WaRZ is offline
 
Join Date: Apr 2010
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I send it in private msg!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:54 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04370 seconds
  • Memory Usage 2,264KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete