How to Put Boxes Around Text in HTML
- 1). Open the document that contains the text you want to create a box for.
- 2). Type the start "<div>" tag at the beginning of your text, and the end "</div>" tag at the ending of your text. For instance: "<div><p>my block of text</p></div>."
- 3). Insert the style attribute to define a border style as follows:
<div style="border:1px solid red;">
<p>my block of text</p>
</div>
Your text will be surrounded by a 1-pixel-wide red box.
Source...