Please anyone knows how to draw a line or a rectangle in HTML?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can use a borderd div :

<DIV style="width:100px;height:100px;border:1px solid black;position:absolute;top:100px;left:100px"></DIV>

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
If you just want to draw a horizontal line then use the following code:

<hr color="#FF0000"><hr align="center" width="90%" size="2">

Color is hex value - leave out for default
Align = left, center or right
Width is width of line as a %age of the screen
Size is line thickness.

Correction to above post...
<hr align="center" width="90%" size="2" noshade color="#FF0000">

Remove noshade for a 3d effect

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

u could do the above but svg i believe would be a better choise
<!-- 4x4 dot (blue) -->
<div style="overflow:hidden; width:4px; height:4px; background-color: blue;"></div>

<!-- small red line -->
<div style="overflow:hidden; width:100%; height:1px; background-color: red;"></div>
Try with VML, that's not exactly html but you can use inside a web page. The direction to learn is http://www.microsoft.com/mind/0100/VML/VML.asp (thank's to COBOLdinosaur).
The only problem is that only works on MSIEv5.0, but with that language you can do a lot of things with few code (and also few things with a lot of code).
Hope that helps you.
You could use the following for a rectangle.

You can remove the legend tags that prints in the rectangle.


<LEGEND><FONT SIZE=2>This is optional</FONT></LEGEND> <!-- Remove the legend tags if you want. -->
<BR>&nbsp;&nbsp;This placeholder text<BR><BR>
the best that i've seen is the fieldset as mentioned above...the coding goes as follows
<TABLE width=xx>
content goes here...

this will give you a rectangle surrounding your content, with a break in the rectangle line for your title. kinda like..

|--  Title --------------------|
|                              |
|  content                     |

it's a good effect.
This question has been classified abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

Unless it is clear to me that the question has been answered I will recommend delete.  It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.

If the user does not know how to close the question, the options are here:


It is time to clean this abandoned question up.

I am putting it on a clean up list for CS.

split avner and MusicMan


If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.