小编gau*_*hor的帖子

对多个HTML标记使用相同的ID?

可能重复:
具有相同ID的多个元素响应一个CSS ID选择器

下面是我测试的示例代码,我感到困惑.每个人都说我们可以使用或者我们应该每个id只使用一次,但我有睾丸使用它多次,但它给了我正确的输出.

我该怎么办?

在这个例子中,对我来说,它类似于类

码:

<html>
<head>
<style>

#exampleID1 { background-color: blue; } 
#exampleID2 { text-transform: uppercase; } 

</style>
</head>
<body>
<p id="exampleID1">This paragraph has an ID name of "exampleID1" and has a blue CSS defined background.</p>
<p id="exampleID2">This paragraph has an ID name of "exampleID2" and has had its text transformed to uppercase letters.</p>

<address id="exampleID1">

Written by W3Schools.com<br />
<a href="mailto:us@example.org">Email us</a><br />
Address: Box 564, Disneyland<br />
Phone: +12 34 56 78
</address>


<blockquote id="exampleID1"> …
Run Code Online (Sandbox Code Playgroud)

html css css-selectors

7
推荐指数
2
解决办法
3万
查看次数

在expressjs中我们应该使用Jade还是React作为视图引擎

我是 Expressjs 的新手,开始使用 MERN Stack 构建一个项目。

我很困惑应该使用jade\pug、EJS、React 哪个视图引擎。

我已经使用 jade 将包含 mongodb 内容的页面渲染到浏览器中。我应该使用后端以 json 形式提供内容,而不是将整个页面呈现为 HTML。

我还尝试实现https://github.com/reactjs/express-react-views ,以便我可以使用 React 从服务器渲染页面。但是“express-messages”和“connect-flash”npm 包存在一些问题。

node.js express reactjs pug

3
推荐指数
1
解决办法
6431
查看次数

标签 统计

css ×1

css-selectors ×1

express ×1

html ×1

node.js ×1

pug ×1

reactjs ×1