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.
我正在尝试创建一个小部件/平铺对象以显示在我的页面上。基本上它是一个带有背景颜色的矩形框,我想在其中显示一些文本。
具体来说,我想创建像 dashing (dashing.io) 中的小部件。
我对 JS/HTML 有点陌生。
HTML:
<div class=widget> <h2>Some text</h2> </div>
CSS:您可以更改值
.widget { width: 100px; height: 100px; background-color: red; } h2 { margin: auto; }