有CSS的替代品吗? [英] Is there an alternative to CSS?

查看:233
本文介绍了有CSS的替代品吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CSS是否有替代CSS的样式表格式语言?还是CSS的当前单一语言做Style Sheet格式化事情?

Is there a style sheet formatting language alternative to CSS? Or is CSS the current single language for doing Style Sheet formatting type things?

我看了维基百科上CSS的写法( http://en.wikipedia.org/wiki/Cascading_Style_Sheets )和一些其他关于CSS的评论,并对不支持CSS在不同的布局引擎缺乏完全支持,所以我只是好奇if有一个替代或者我必须学会使用CSS过滤器。

I looked at the write up of CSS on Wikipedia (http://en.wikipedia.org/wiki/Cascading_Style_Sheets) and a few other comments about CSS and became discouraged about the lack of full support for CSS in the different Layout engines, so I am just curious if there is an alternative or I must learn to also use CSS filters.

感谢任何见解。

推荐答案

CSS是唯一真正的选择。

CSS is the only real option.

浏览器支持CSS不应该是一个主要问题(在大多数情况下) CSS的。了解CSS的关键是它的目的是定义一个HTML文档的样式,它应该与内容分开。

Browser support for CSS should not be a major concern (in most cases) once you learn the ins & outs of CSS. The key to understand about CSS is that its purpose is to define the style of an HTML document and it should be separate from the content.

你需要练习在学习如何使事情在不支持功能的浏览器中正常降级。这里的基本思想是,你应该使最低的共同特征(Internet Explorer通常)工作足够好,它不会带走用户体验,并为用户提供更好的浏览器。此外,不要首先为Internet Explorer开发。离开它,直到最后,然后修复它的错误。

You'll need practice in learning how to make things degrade gracefully in browsers that don't support features. The basic idea here is that you should make the lowest common denominator (Internet Explorer usually) work "good enough" that it doesn't take away from the user experience, and provide the niceties for users with better browsers. Also, don't develop for Internet Explorer first. Leave it until last, then fix its bugs. Doing things the other way around (IE first) is much harder.

您还可以选择使用JavaScript来设置样式,但不建议这样做,因为您应该避免在JavaScript中应用样式,因为JavaScript是用于逻辑,而不是样式。

You also have the option of using JavaScript to set styles, but that is not recommended because you should avoid applying styles within JavaScript since JavaScript is meant for logic, not styles.

有3个(取决于你如何看待它)组件到网页:

There are 3 (depending how you look at it) components to a web page:


  • HTML - 用于内容

  • CSS <为您的内容套用额外或动态逻辑

  • HTML - for content
  • CSS - for styling your content
  • JavaScript - for applying additional or dynamic logic to your content

这篇关于有CSS的替代品吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆