Thank you all for your answers. I understand that %26lt;hr%26gt; is used to render the horizontal rule in a HTML document. However, my assigment requests to create a horizontal rule using given image with .gif extension (it's kind of ready-made horizontal line). But I don't know how to use that image for the horizontal rule. Anyone can help me, please! Thank you all in advance!
How to create a horizontal rule which should be a graphic in a HTML document?
You can do it several ways...
1. Insert your gif at the point you want, like any other image, but set its width to 100%. That will expand it to fit its maximum allowed. For example:
%26lt;img src="yourpic.gif" width="100%" height="1" alt=""%26gt;
...the drawback is that this method deforms the image, so it works better with single-color pics.
2. Make a div (layout object) and use CSS to make your gif repeat in the background. This way the gif never distort its dimensions. Example.
%26lt;div style="background:url( yourpic.gif ) repeat-x"%26gt;%26lt;/div%26gt;
You can set other options in your style (like height and margins), so this method is very versatile. If you plan to use your "hr" often (like a real %26lt;hr%26gt;), I recommend you to make a class in CSS and put your code in an external file, so you can put (and eventually change) your "ruler" div with less effort.
More details on CSS... well, you can search on the Internet for "css tutorials". There are hundreds (maybe thousands) out there! But if you don't know where to start, go to http://www.w3schools.com/css/default.asp
..or you can always ask again for more help!
Reply:use these tags:
%26lt;table width="100%" height="y px" border="0" cellpadding="0" cellspacing="0"%26gt;
%26lt;tr%26gt;
%26lt;td background="image.gif"%26gt; %26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;/table%26gt;
where image.gif is the image name and y is the height of the image in pixels
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment