How to create a dashing like widget object in javascript

448 Views Asked by At

I am trying to create a widget/tile object to display on my page. Basically its a rectangular box with a background color which I would like to display some text in.

To be specific I want to create widgets like the ones in dashing (dashing.io).

I am kinda new to JS/HTML.

1

There are 1 best solutions below

0
On BEST ANSWER

HTML:

<div class=widget>
<h2>Some text</h2>
</div>

CSS: You can change the values

.widget {
width: 100px;
height: 100px;
background-color: red;
}
h2 {
 margin: auto;
}