将图像属性移动到CSS [英] Moving image properties to CSS
问题描述
我目前正在使用其中一个IE黑客为PNG图像提供完整的alpha
透明度。但是我希望尽可能多地将这些数据移动到.CSS
来减轻HTML中的负载,因为它在每个页面上使用。这是我的HTML:
< div id =" logo1"
style =" width:128px; height:100px; filter:progid: DXIm ageTransform.Microsoft.AlphaIm
ageLoader(src =''images / logo-128x100x32.png'');">
< img style =" filter:progid:DXImageTransform.Microsoft.Al pha(opacity = 0);"
src =" ../ images / logo-128x100x32.png"宽度= QUOT; 128"高度= QUOT; 100" border =" 0"
alt =" Matroska Logo">
< / div>
这是我正在使用的CSS:
#logo1 {
职位:绝对;
top:10px;
剩余:10px;
}
什么都可以移动到.CSS文件?我最感兴趣的是移动
属性的样式。
Atamido
---- ==通过Newsfeed.Com发布 - 无限制 - 未经审查 - 安全使用网新闻== ----
http ://www.newsfeed.com 世界排名第一的新闻组服务! > 100,000新闻组
--- = 19东/西海岸专业服务器 - 通过加密的总隐私= ---
I am currently using one of the IE hacks to give a PNG image full alpha
transparency. But I wanted to move as much of this data to a .CSS as possible
to lighten the load in the HTML as it is uses on every page. Here is my HTML:
<div id="logo1"
style="width:128px;height:100px;filter:progid:DXIm ageTransform.Microsoft.AlphaIm
ageLoader(src=''images/logo-128x100x32.png'');">
<img style="filter:progid:DXImageTransform.Microsoft.Al pha(opacity=0);"
src="../images/logo-128x100x32.png" width="128" height="100" border="0"
alt="Matroska Logo">
</div>
Here is the CSS I am using for it:
#logo1 {
position: absolute;
top: 10px;
left: 10px;
}
What all can I move to the .CSS file? I am most interested in moving the style
properties over.
Atamido
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
推荐答案
John写道:
John wrote:
我目前正在使用其中一个IE黑客为PNG图像提供完整的alpha
透明度。但是我希望尽可能多地将这些数据移动到.CSS中,以减轻HTML中的负载,因为它在每个页面上使用。这是我的HTML:
< div id =" logo1"
style =" width:128px; height:100px; filter:progid:DXIm ageTransform.Microsoft.AlphaIm
ageLoader(src =''images / logo-128x100x32.png'');">
< img style =" filter:progid:DXImageTransform.Microsoft.Al pha(opacity = 0);
src =" ../ images / logo-128x100x32.png宽度= QUOT; 128"高度= QUOT; 100" border =" 0"
alt =" Matroska Logo">
< / div>
以下是我正在使用的CSS:
#logo1 {
位置:绝对;
顶部:10px;
左:10px;
}
我可以搬到什么地方.CSS文件?我最感兴趣的是移动样式
属性。
I am currently using one of the IE hacks to give a PNG image full alpha
transparency. But I wanted to move as much of this data to a .CSS as possible
to lighten the load in the HTML as it is uses on every page. Here is my HTML:
<div id="logo1"
style="width:128px;height:100px;filter:progid:DXIm ageTransform.Microsoft.AlphaIm
ageLoader(src=''images/logo-128x100x32.png'');">
<img style="filter:progid:DXImageTransform.Microsoft.Al pha(opacity=0);"
src="../images/logo-128x100x32.png" width="128" height="100" border="0"
alt="Matroska Logo">
</div>
Here is the CSS I am using for it:
#logo1 {
position: absolute;
top: 10px;
left: 10px;
}
What all can I move to the .CSS file? I am most interested in moving the style
properties over.
您可以移动所有样式属性。这就是它们 - 内联
CSS。
#logo1 {
position:absolute;
top:10px;
剩余:10px;
宽度:128px;
身高:100px;
filter:progid:DXImageTransform.Microsoft.AlphaImag eLoader(src =''images / logo-128x100x32.png'');
}
#logo1 img {
filter:progid:DXImageTransform.Microsoft.Alpha(opa city = 0);
宽度:128px;
身高: 100px;
border:none;
}
< div id =" logo1">< img src = QUOT; ../图像/标志-128x100x32.png" alt =" Matroska Logo">< / div>
-
马特
- ---- =通过Newsfeeds.Com发布,未经审查的Usenet新闻= -----
http://www.newsfeeds.com - 世界排名第一的新闻组服务!
----- ==超过100,000个新闻组--19个不同的服务器! = -----
You can move all the style properties over. That''s what they are -- inline
CSS.
#logo1 {
position:absolute;
top:10px;
left:10px;
width:128px;
height:100px;
filter:progid:DXImageTransform.Microsoft.AlphaImag eLoader(src=''images/logo-128x100x32.png'');
}
#logo1 img {
filter:progid:DXImageTransform.Microsoft.Alpha(opa city=0);
width: 128px;
height: 100px;
border: none;
}
<div id="logo1"><img src="../images/logo-128x100x32.png" alt="Matroska Logo"></div>
--
Matt
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
" Matt"写道...
"Matt" wrote...
您可以移动所有样式属性。这就是它们 - 内联
CSS。
#logo1 {
位置:绝对;
顶部:10px;
左:10px ;
宽度:128px;
高度:100px;
过滤器:progid:DXImageTransform.Microsoft.AlphaImag eLoader(src =''images / logo-128x1
00x32.png''); }
#logo1 img {
过滤器:progid:DXImageTransform.Microsoft.Alpha(opa city = 0);
宽度:128px;
高度:100px;
border:none;
}
< div id =" logo1">< img src =" ../ images / logo-128x100x32.png" alt =" Matroska
You can move all the style properties over. That''s what they are -- inline
CSS.
#logo1 {
position:absolute;
top:10px;
left:10px;
width:128px;
height:100px;
filter:progid:DXImageTransform.Microsoft.AlphaImag eLoader(src=''images/logo-128x1
00x32.png''); }
#logo1 img {
filter:progid:DXImageTransform.Microsoft.Alpha(opa city=0);
width: 128px;
height: 100px;
border: none;
}
<div id="logo1"><img src="../images/logo-128x100x32.png" alt="Matroska
徽标">< / div>
IE和Mozilla都让这个页面很好,但现在CSS不会有b $ b验证。它不喜欢
过滤器中的所有冒号:progid:DXImageTransform.Microsoft.AlphaImag eLoader(src =''images / logo-128x1
00x32.png '');
有没有办法解决它以便验证?另外,有没有办法把s / =
src =""和alt =""在.CSS?
感谢您的帮助!
Atamido
--- - ==通过Newsfeed.Com发布 - 无限制 - 未经审查 - 安全Usenet新闻== ----
http://www.newsfeed.com 世界排名第一的新闻组服务! > 100,000新闻组
--- = 19东/西海岸专业服务器 - 通过加密的总隐私= ---
Logo"></div>
Well both IE and Mozilla render the page fine like that, but now the CSS won''t
validate. It doesn''t like all of the colons in
filter:progid:DXImageTransform.Microsoft.AlphaImag eLoader(src=''images/logo-128x1
00x32.png'');
Is there any way to fix it so that it validates? Also, is there any way to put
the src="" and alt="" in the .CSS?
Thanks for your help!
Atamido
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
John写道:
John wrote:
有没有办法把src =""和alt =""在.CSS?
is there any way to put the src="" and alt="" in the .CSS?
否;这些是文档内容的一部分,并且在CSS的范围之外是
。
-
Brian (删除.invalid给我发电子邮件)
http://www.tsmchughs。 com /
这篇关于将图像属性移动到CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!