Is there an alternative to CSS?

后端 未结 21 2001
忘掉有多难
忘掉有多难 2021-01-30 02:26

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

I looked at the wr

21条回答
  •  失恋的感觉
    2021-01-30 02:42

    CSS is the only real option.

    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.

    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.

    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.

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

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

提交回复
热议问题