School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,124 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,009 people online right now. Registration is fast and FREE... Join Now!




inline image versus CSS image

 

inline image versus CSS image

Torroes_prime

4 Nov, 2009 - 08:05 PM
Post #1

D.I.C Head
**

Joined: 7 Jun, 2009
Posts: 71


My Contributions
So I was in my Web Design class tonight, and the teacher posed the question, "in regards to separating Content from presentation, when would you want to use an inline image versus setting it using the background-image property in an external style sheet?"

So obviously, it would be a better option to use CSS for stuff like nav-bars, Logos, and anything else that is used repeatedly through out the site. Even with in article images, you would get more control over formatting with image and it's border and everything else.

so... yeah. When would you want to use an image inline versus a CSS element?

User is offlineProfile CardPM
+Quote Post


jwwicks

RE: Inline Image Versus CSS Image

4 Nov, 2009 - 09:05 PM
Post #2

D.I.C Head
Group Icon

Joined: 31 Jul, 2008
Posts: 151



Thanked: 22 times
Dream Kudos: 250
My Contributions
Hello,

QUOTE(Torroes_prime @ 4 Nov, 2009 - 08:05 PM) *

So I was in my Web Design class tonight, and the teacher posed the question, "in regards to separating Content from presentation, when would you want to use an inline image versus setting it using the background-image property in an external style sheet?"

So obviously, it would be a better option to use CSS for stuff like nav-bars, Logos, and anything else that is used repeatedly through out the site. Even with in article images, you would get more control over formatting with image and it's border and everything else.

so... yeah. When would you want to use an image inline versus a CSS element?


When the image is the content you should use the image tag. If I have a gallery of images a user is free to turn off styling/css or print a page and the images will still show. When it is simply a styling element, background, rounded corners etc... use CSS

Jw
User is offlineProfile CardPM
+Quote Post

SubTypical

RE: Inline Image Versus CSS Image

9 Nov, 2009 - 06:55 AM
Post #3

New D.I.C Head
*

Joined: 3 Nov, 2009
Posts: 6


My Contributions
QUOTE(jwwicks @ 4 Nov, 2009 - 09:05 PM) *

Hello,

When the image is the content you should use the image tag. If I have a gallery of images a user is free to turn off styling/css or print a page and the images will still show. When it is simply a styling element, background, rounded corners etc... use CSS

Jw


Agreed. When you disable the CSS, an image defined as a css background element is disabled as well. If it is content, it should be in-line (and always make sure to enter the 'alt' description under the image tag for accessibility purposes).

The only time you'd want to have content-related images as a background image is if you're using one of the various techniques to replace text (headers, etc.) with a decorative alternative. It would keep the users from being able to scale your site and adjust fonts, etc. for the headers that may break your design. The problem is none of the methods work flawlessly, they all have some impact on accessibility/seo/etc. So it should be used sparingly or not at all IMO.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 02:07PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month