iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Graphics & Design Discussion Forum Post your graphics design questions/comments/ideas in here. Ask questions, post tutorials, discuss trends and best practices. Sub-forum for website accessibility and usability.

Share Thread: & Tags

Share Thread:

Tags
background images, css styling

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-13-2009, 09:58 AM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,683
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Question Background image: How to?

I use CSS and images for my styling, but don't use the

background-image:url('backgroundimage.gif');

CSS styling rule.

Take the last link in my example. Looking at the code you will find markup like this

<img alt="" src="http://www.oopschool.com/styling/gblnav_left.gif" height="32" width="4" id="gnl">

My simple question:

Is there any reason that I should change to the first format and link to images in the CSS stylesheet?
Reply With Quote
  #2 (permalink)  
Old 09-14-2009, 05:02 PM
ran_dizolph's Avatar
WebProWorld Veteran
 
Join Date: Jul 2005
Location: Windsor, ON
Posts: 543
ran_dizolph RepRank 2
Default Re: Background image: How to?

Well, the format you use isn't really a 'background' image per se, it's directly in the code. Furthermore what you've displayed is deprecated (height and width inline).

The idea with background images as to my understanding, is to use them more for layout, as opposed to actual content. That's the way I separate the two. If an image has to do with the content on the site, use the img tag, if not, use a background image.
Reply With Quote
  #3 (permalink)  
Old 09-14-2009, 05:06 PM
weslinda's Avatar
WebProWorld Veteran
 
Join Date: Mar 2006
Location: Maryland, USA
Posts: 977
weslinda RepRank 3weslinda RepRank 3
Default Re: Background image: How to?

Guess it depends on if the image is unique for various pages vs the style sheet. If the image is the same sitewide, it makes it easier to change that image if you're working in css, as you can use a new image, change the placement of the image, remove the image, so forth and so on.

My 2 Cents on that one.
__________________
We offer a total eCommerce solution with eCommerce Web Design using Pinnacle Cart
Reply With Quote
  #4 (permalink)  
Old 09-14-2009, 08:05 PM
ronchalice's Avatar
WebProWorld Pro
 
Join Date: Oct 2006
Location: Colorado
Posts: 132
ronchalice RepRank 2ronchalice RepRank 2
Default Re: Background image: How to?

Is it not also true that a CSS background image is only loaded (and painted) once if the CSS is the same from page to page but the img tag is loaded each time it occurs?

Thanks,
Reply With Quote
  #5 (permalink)  
Old 09-15-2009, 01:03 AM
Doc's Avatar
Doc Doc is online now
WebProWorld Veteran
WebProWorld MVP
 
Join Date: Jun 2009
Location: Baja California
Posts: 691
Doc RepRank 9Doc RepRank 9Doc RepRank 9Doc RepRank 9Doc RepRank 9Doc RepRank 9Doc RepRank 9Doc RepRank 9Doc RepRank 9Doc RepRank 9Doc RepRank 9
Default Re: Background image: How to?

Quote:
Originally Posted by ronchalice View Post
Is it not also true that a CSS background image is only loaded (and painted) once if the CSS is the same from page to page but the img tag is loaded each time it occurs?

Thanks,
Very good point, Ron!
__________________
If I ever stop learning, let the wolves have my carcass.
http://doccampbell.wordpress.com/
http://cleanstreamwaterconditioning.com
http://carforums-online.com
Reply With Quote
  #6 (permalink)  
Old 09-17-2009, 11:42 AM
WebProWorld New Member
 
Join Date: Sep 2009
Posts: 6
keddy1 RepRank 0
Default Re: Background image: How to?

ron you have put up an important point.why there is no comment on this.
Reply With Quote
  #7 (permalink)  
Old 09-21-2009, 03:05 PM
WebProWorld New Member
 
Join Date: Sep 2009
Posts: 10
past2future RepRank 0
Default Re: Background image: How to?

if you are planing to link that image then use it in the html code.. but if the image is just a background image and you would like to change the image in future to something else then its better to put it in css file just to keep everything organized as well
Reply With Quote
  #8 (permalink)  
Old 09-21-2009, 07:29 PM
Uncle Dog's Avatar
WebProWorld Pro
 
Join Date: Apr 2008
Location: Scotland
Posts: 254
Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5
Default Re: Background image: How to?

Also, if a visitor decides to print your page, background-image(s) don't ordinarily show up and waste ink or obfuscate text. Normally I put a logo in an img tag so that it is always printed.
Reply With Quote
  #9 (permalink)  
Old 10-23-2009, 02:52 PM
Moderator
WebProWorld Moderator
 
Join Date: Oct 2003
Location: Alberta, Canada
Posts: 878
weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6
Default Re: Background image: How to?

Sorry, kgun, for butting in...

Quote:
Originally Posted by ran_dizolph View Post
Furthermore what you've displayed is deprecated (height and width inline).
Link: HTML img tag

Note that width and height are indeed, still optional attributes of the IMG tag. Including them helps browsers reserve space in the layout and move on to other code without having to wait for the download.
Reply With Quote
  #10 (permalink)  
Old 10-24-2009, 02:58 PM
WebProWorld New Member
 
Join Date: Oct 2009
Posts: 1
kte.moss RepRank 0
Default Re: Background image: How to?

No there is no such compulsion. If you are getting the desired results with this code, then do not change it, just because someone has said you to change.
Reply With Quote
Reply

  WebProWorld > Site Design > Graphics & Design Discussion Forum

Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Image ALT tags with an image name dlamar Search Engine Optimization Forum 9 05-20-2009 09:09 AM
It is a free image hosting site upload image and generate sharing links for easy post imagestored Services for Sale/Hire 0 06-07-2008 02:08 AM
imagexc.com & imgxc.com (image exchange / image hosting) riverbirch Domains Buy/Sell 0 03-01-2008 11:48 PM
Y. Image Search takes you to Image Directory, not website Joe_Wood Yahoo! Discussion Forum 2 12-13-2007 07:27 PM
Help wanted for Image::Magick Remote image size: PERL TrafficProducer Web Programming Discussion Forum 0 02-25-2005 08:03 AM


All times are GMT -4. The time now is 06:29 PM.



Search Engine Optimization by vBSEO 3.3.0