Spread Image Across Page

Thread Solved

Join Date: Feb 2009
Posts: 32
Reputation: Erek4 is an unknown quantity at this point 
Solved Threads: 0
Erek4's Avatar
Erek4 Erek4 is offline Offline
Light Poster

Spread Image Across Page

 
0
  #1
Feb 17th, 2009
OK, after a few hours and some Internet research I think I found a way to spread an image across my page. Let me know what you guys think.

My CSS:
#body {
background-image: url(my image url);
background-attachment: fixed;
}

1) I noticed that the image only fills in 3/4's of the page so what I did was put a few <br />'s so it would fill the page and walaa!! Is this bad practice? Would it work across different browsers?

2) Also, my image is 1024 x 731. How do I compress it and still have the same look, quality and the way it is viewed on the page?

3) I found that I like the look of some of the images that are oversized (meaning that only a portion of it is showing). Is there a way I can keep this look while compressing the image?

At your convenience,

Erek
Last edited by Erek4; Feb 17th, 2009 at 6:57 am.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 211
Reputation: macneato is an unknown quantity at this point 
Solved Threads: 18
macneato's Avatar
macneato macneato is offline Offline
Posting Whiz in Training

Re: Spread Image Across Page

 
1
  #2
Feb 18th, 2009
Hi Erek,

Why would you have line breaks to position an image? Just use something along these lines;

  1. #body {
  2. background: url(my image url) center center fixed;
  3. /*Other possible values include: top,right,bottom and left*/
  4. }

That's the biggest issue with using lage images as backgrounds, use a photo editing application to find out what format and output quality sorts your purpose best.

As for your last question, if you just like that portion of the image showing, crop it accordingly and position it where you like it to be displayed.

All the best,
If this reply solved your problem, please add to my reputation and don't forget to mark this thread as solved.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 32
Reputation: Erek4 is an unknown quantity at this point 
Solved Threads: 0
Erek4's Avatar
Erek4 Erek4 is offline Offline
Light Poster

Re: Spread Image Across Page

 
0
  #3
Feb 19th, 2009
Magneato, thanks for the tip and your patience, I will try this out. I will crop the image and size it accordingly and see how this works.

(Previously, I used the line break to lower the image to the bottom of the page, if I didn't it would show some white space at the bottom instead.)

The image format for my background is a jpg. from psdrockstar.com.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 32
Reputation: Erek4 is an unknown quantity at this point 
Solved Threads: 0
Erek4's Avatar
Erek4 Erek4 is offline Offline
Light Poster

Re: Spread Image Across Page

 
0
  #4
Feb 21st, 2009
I did what you said by adding the followind in my css:

background: url(../../images/b2.jpg) center center fixed;
I cannot, however, spread the image across the page for some reason. Also, what is a good height and width for a background image in the css?
Last edited by peter_budo; Feb 21st, 2009 at 4:32 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 32
Reputation: Erek4 is an unknown quantity at this point 
Solved Threads: 0
Erek4's Avatar
Erek4 Erek4 is offline Offline
Light Poster

Re: Spread Image Across Page

 
0
  #5
Feb 25th, 2009
[QUOTE=macneato;806593]Hi Erek,

Why would you have line breaks to position an image? Just use something along these lines;

  1. #body {
  2. background: url(my image url) center center fixed;
  3. /*Other possible values include: top,right,bottom and left*/
  4. }


I used the background: url() center center fixed;
I now need to spread the image from the center to the edges of the website (webpage). Is there an easy way to do this?

Erek
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 25
Reputation: efaith77 is an unknown quantity at this point 
Solved Threads: 1
efaith77's Avatar
efaith77 efaith77 is offline Offline
Light Poster

Re: Spread Image Across Page

 
0
  #6
Feb 26th, 2009
Here is a cool little link I found that may help you out.
http://www.htmlite.com/faq022.php
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 32
Reputation: Erek4 is an unknown quantity at this point 
Solved Threads: 0
Erek4's Avatar
Erek4 Erek4 is offline Offline
Light Poster

Re: Spread Image Across Page

 
0
  #7
Feb 28th, 2009
James this is great! I will implement this into my site.
Thanks a lot!!!
Erek
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 25
Reputation: efaith77 is an unknown quantity at this point 
Solved Threads: 1
efaith77's Avatar
efaith77 efaith77 is offline Offline
Light Poster

Re: Spread Image Across Page

 
0
  #8
Feb 28th, 2009
Glad to help
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC