客户端:HTML、DOM 和 CSS?

2022-01-19 00:00:00 client frontend dom html css

我没有在应用程序的 Client Side/Front End 上进行广泛的工作,我正在尝试阅读有关 HTML、CSS 和 DOM 的信息,但不知何故无法弄清楚找出它们之间的区别,如果有人可以的话,我会非常感激:

I have not worked extensively on Client Side/Front End of the Application and I am trying to read about HTML, CSS and DOM but somehow am not able to figure out difference between them and so would really appreciate if someone can:

  1. 用简单的英语解释一下 HTML、CSS 和 DOM 是如何工作的?
  2. 从客户端技术的角度来看,它们如何相互关联?

更新我浏览了 wikipedia 文章,但无法清楚地理解 DOM 的工作原理.

Update I have gone through wikipedia articles but not able to clearly understand working of DOM.

谢谢.

推荐答案

HTML 是您网站上的内容(标题、列表、表格)

HTML is what is on your website (headings, lists, tables)

CSS 就是这些东西的样子(边框、颜色、字体大小)

CSS is what those things look like (borders, colours, font sizes)

DOM 是您通过 javascript 访问这些东西的方式(获取节点、添加新元素、更改它们的样式)

DOM is how you access those things through javascript (getting nodes, adding new elements, changing their style)

这是 3 个一起工作的示例(在 ie 中似乎不起作用)http://jsfiddle.net/gj9zT/

Here is an example of the 3 working together (doesn't seem to work in ie) http://jsfiddle.net/gj9zT/

相关文章