Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个搜索结果页面,我想将每个结果包装在一个简单的框中以区分每个组,但我找不到任何有关如何执行此操作的信息。我发现的只是盒子模型上的 w3schools 页面,这似乎会影响整个页面,所以它并不是我真正想要的。
您需要将它们包装在所谓的中,div这实际上是对浏览网站的浏览器说“这是一个块,像那样对待它”。你可以像这样创建一个div
div
<div class="result">Content in here!</div>
然后,您可以为所有 div 分配 CSS 类result,这样您就可以使用 CSS 代码,例如
result
.result { border: 1px solid red; }