HighDots Forums  

putting an image link into the CSS

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss putting an image link into the CSS in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Bergamot
 
Posts: n/a

Default Re: putting an image link into the CSS - 09-24-2007 , 07:59 AM






Thomas 'PointedEars' Lahn wrote:
Quote:
the `a' element contained nothing else but
the `img' element, the `img' element has to refer to a graphic providing
information about the purpose of the link.

such an image would still not be presentational (it has
*meaning*), and so CSS would be the wrong approach.
Actually, the alt text to go with that image would have meaning, not
necessarily the image itself. Seems to me the whole purpose of the OP's
inquiry was to be able to style the link independently of its content
(which is probably the alt text, not the graphic), and is *exactly* the
right job for CSS.

Such a change often requires thinking about the content differently than
the old-school way supplied by the OP. You're intentions on this subject
may be in the right place, but your advice is too narrow-minded. Look at
the problem from a different angle and you'll see more possibilities.

--
Berg


Reply With Quote
  #12  
Old   
Jon Fairbairn
 
Posts: n/a

Default Re: putting an image link into the CSS - 09-24-2007 , 08:44 AM






Andy Dingley <dingbat (AT) codesmiths (DOT) com> writes:

Quote:
On 23 Sep, 00:05, Cartoper <carto... (AT) gmail (DOT) com> wrote:
I want to move the image for a link from the HTML to the CSS, but
cannot figure out how to do it.

Don't. CSS only does "background" images,
Not /only/ background images:

<style>
a#muddy-the-waters:before
{ content: url("mud.png");
}
</style>

Cross-browser operation? Pardon, what was that? I heard the
"cross" bit...

--
Jón Fairbairn Jon.Fairbairn (AT) cl (DOT) cam.ac.uk


Reply With Quote
  #13  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: putting an image link into the CSS - 09-24-2007 , 01:08 PM



Bergamot wrote:
Quote:
Thomas 'PointedEars' Lahn wrote:
the `a' element contained nothing else but the `img' element, the `img'
element has to refer to a graphic providing information about the purpose
of the link.

such an image would still not be presentational (it has
*meaning*), and so CSS would be the wrong approach.

Actually, the alt text to go with that image would have meaning, not
necessarily the image itself.
If the image would be the only content of the `a' element as the OP stated,
the image would not be presentational, period.


PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann


Reply With Quote
Reply




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.