dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: CSS based images?

  1. #1
    Join Date
    Dec 2005
    Posts
    62

    CSS based images?

    Hi all. Apologies in advance but perhaps my brain is fried.

    I have image replacement working pretty well for text. So when CSS is disabled, the page still has text and makes sense. The whole reason for me to go fully CSS was to allow me to easily swap files in future for changing my design radically.

    Here is the silly question of the day.
    How do I say swap graphics headers alone when there is no text at all? From what I see, the img source seems to be always defined in the html and not in the css file?

    What I want is something like <img id="xx"> where I can vary the source image by changing the css file. So far it seems that <img id="xx" src="yy"> (source must be defined?) If so, how can I avoid hardcoding the path to source in html?

    I guess the approach is to use an empty <div id="yy"></div> to place headers where the source is defined in css? Is this the accepted approach?

    My guess is I have the wrong assumptions.

    Thanks.
    Last edited by supersteve3d; 07-13-2006 at 07:44 PM.

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,614
    The only way via CSS would be if it were a background image, as far a I know.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles