Regarding the line... depending of the type of line you want (if it is horizontal, vertical or a free form as you posted...) there are different ways.
For a free form, you will need a picture and place it inside the box (probably as a background picture) and then place it
Use CSS for that. CSS properties like position, top, left and background should get you sorted.
For a vertical or horizontal line... if it is the border of the box, you simply need to use the CSS property border (that would be for all top, bottom, left and right borders) or border-top, border-left, etc. if you simply one of them.