Solved

Image SRC in CSS?

Posted on 2003-12-01
4
710 Views
Last Modified: 2013-11-19
Is there a way I can define the SRC of an Image tag in CSS?

Please note:
I have already tried using the background-image property, but it doesn't solve the fact that I don't declare the src and thereby shows an image marker in IE for the placeholder with the correct image in the background... thus not a good solution.
0
Comment
Question by:yleviel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 31

Expert Comment

by:seanpowell
ID: 9853484
>>but it doesn't solve the fact that I don't declare the src

You can't have an image if you don't declare the source, CSS or otherwise...
0
 
LVL 15

Accepted Solution

by:
Timbo87 earned 25 total points
ID: 9853538
You can set the properties of the image with CSS, but you cannot specify the src with CSS.

<img style="border:0;width:300px;height:200px" src="mypic.jpg">

If you need to change the src in the life of the document you could do that with JavaScript.
0
 
LVL 2

Author Comment

by:yleviel
ID: 9853606
the whole point is to allow a user to define their own images in a single sheet rather then having to find and replace each case.
0
 
LVL 15

Expert Comment

by:Timbo87
ID: 9853657
You could have the user set custom images with cookies.
0

Featured Post

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question