根据浏览器分辨率更改样式表定义

根据浏览器分辨率更改样式表定义

本文介绍了根据浏览器分辨率更改样式表定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个公司内部网上的门户网站。门户网站是

设计,记住1024 * 768的分辨率。我在所有文件中都包含了一个

..css文件。现在我必须使文件兼容

1024 * 768和800 * 600分辨率。我不想更改所有

文件以包含备用css。我可以在css文件中写一些javascript

条件来更改基于

分辨率的类定义。我不是Stylesheets的专家,并且没有找到任何

匹配谷歌搜索我的问题的讨论。


请帮忙。在此先感谢。

Techie

解决方案

的类定义

CSS文件不能包含javascript(尽管如此,它可能是使用

MSIE中的一些错误来模仿这样的功能)。我建议你重写CSS风格的

,以便网站可以很好地适应任何分辨率,但是你可能不太了解CSS。
/>

如果您确定javascript解决方案是可以的,那么你可以这样做,

然后继续使用文本编辑器,可以搜索/替换多个

文件。


如果没有看到HTML中的标记我会猜测标记会是什么?b $ b需要修复,所以你要'在任何情况下都需要修改每个文件。


请设置跟进.stylesheets或.javascript取决于

你要讨论哪个解决方案关于。


-

Mikko





< >


-

Brian

按照我的地址中的说明发送电子邮件我





编号样式表是静态的,没有脚本编写方法。


我建议您将样式表链接更改为Javascript文件,

并让该document.write正确的样式表链接。


因为您可以假设Javascript已启用,您可能会

甚至省略默认样式表。


/ L

-

Lasse Reichstein Nielsen -

Art D ''HTML:< URL:http://www.infimum.dk/HTML/randomArtSplit.html>

''没有判断的信仰只会降低精神神圣。''

Hi All,
I have a portal working on an intranet for a company. The portal was
designed keeping in mind the resolution of 1024*768. I am including a
..css file in all the files. Now i have to make the file compatible for
both 1024*768 and 800*600 resolutions. I don''t want to change all the
files to include an alternate css. Can i write some javascript
conditions in the css files to change the class definitions based on
resolutions. I am not an expert in Stylesheets and did not find any
matching discussions on google for my problem.

Please do help. Thanks in Advance.
Techie

解决方案



CSS files cannot contain javascript (though, it might be possible to use
some bug in MSIE to emulate such feature). I''d suggest you to rewrite
the CSS style so that the site scales well for any resolution but you
probably don''t know CSS well enough.

IF you KNOW for sure that javascript solution is ok and you can do that,
then proceed with a text editor that can do search/replace for multiple
files.

Without seeing the markup in the HTML I''d guess that the markup would
need fixing anyway so you''d need to modify every file in any case.

Please, setup followups to either .stylesheets or .javascript depending
on which solution you want to discuss about.

--
Mikko




< http://www.allmyfaqs.com/cgi-bin/wiki.pl?AnySizeDesign >

--
Brian
follow the directions in my address to email me




No. Style sheets are static, and have no methods of scripting.

I suggest you change the style sheet link to a Javascript file,
and let that document.write the correct style sheet link.

Since you can probably assume that Javascript is enabled, you might
even omit a default style sheet.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D''HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
''Faith without judgement merely degrades the spirit divine.''


这篇关于根据浏览器分辨率更改样式表定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 18:43