I have a div that needs to be identified using a line and box(which will contain a message) like in the below mockup image.2 and 3(Line and a rectangular box) are fixed to each
I would suggest you use a png image for the line part, or an svg. It would be much easier.
Short answer, because the code has already been given by others above.