Re: [css3-images] image() notation and <img>

I suppose the codes below could achieve same purpose.

<style>
     #myDiv {
       background-image: url('myLogo.png');
     }
</style>

   <div id="myDiv">....</div>
   ....
   <img id="myLogo" src="myLogo.png"/>


The document have <img /> element and the <img /> has 'src' attribute. I  don't feel that need a new feature.

Greetings,
Jinlong




Zhang Jinlong --- Web Specialist

skype : jinlong3546
QQ : 237585693
Weibo : http://weibo.com/newwave




From: Daniel Glazman
Date: 2012-11-21 17:09
To: www-style@w3.org
Subject: [css3-images] image() notation and <img>
Can I write the following?

   <style>
     #myDiv {
       background-image: image('#myLogo');
     }
   </style>

   <div id="myDiv">....</div>
   ....
   <img id="myLogo" src="myLogo.png"/>

expecting the div will acquire the logo as background-image
or should the target of image() here be an image format?
I don't think the CSS Image Values and Replaced Content Level 3
spec is clear enough about this in section 3.2 and it probably
needs a clarification as a note or warning?

</Daniel>

Received on Thursday, 22 November 2012 03:54:16 UTC