You did something wrong in your styling. The text is INSIDE the box. Since you didn't show the styling you used for the DIV, it's pretty much impossible to say what you did wrong.
This works as expected:
<html>
<head></head>
<body>
This is the 1st line
<div style="
border-style: solid;
border-width: 1px;
border-color: blue;
display: block;
">
This is a test...
</div>
This is the 3rd line
</body>
</html>