In Dreamweaver, if you insert a Horizontal Rule (horizontal line), this line is only gray by default. In many cases, this does not meet our requirements. What should you do if you want to insert straight lines of other colors (even as thin as a pixel)?
First, insert a Horizontal Rule at an appropriate position in the document window (webpage editing window), and
press ctrl + F3 to bring up the Property inspector panel),
In this property panel, uncheck the box in front of shading. Enter the pixel value (pixels) or percentage in W to set the length of this line. In H, entering 1 can make this line very thin, as thin as one pixel. If you want a thicker line, enter a larger value in H. In this way, the thin wire is inserted, but you will find that this wire is gray, and the color cannot be set in the properties panel. If you want to set other colors, you can control it through css. Setting up css is very easy in DreamWeaver, and you don’t even need to understand the syntax of css at all.
Select CSS style | New Style under the Text menu,
In the "New Style" dialog box, enter a name in the name column, such as "colorline", and select "This document only" in the Define radio button. )" and click OK. The Style definition for .colorline dialog box will then pop up:
In the type project, select the color you want, such as red, then click ok, then click done, and a new style is created. Select the thin line in the web page editing window and click Text | CSS style | colorline (colorline is the new style just created). In the web page editing window, the color of the line is still gray, but press F12 to preview it in the browser. You can see that the color of the inserted thin line has changed to the red you want.
There is another way to insert colored thin lines, even as thin as one pixel. First insert a table with one row and one column in the web page editing window, and then insert a 1pixel × 1Pixel transparent image in the table (control the page in dreameaver4 The spacer image used in the layout is exactly such an image, so if you don't know how to use software to create such an image, you can generate it in dreameaver4 like this:
In the Object panel, first click the layout view in the View of the Object panel, then click draw layout table, drag in the web page editing window to generate a layout table, and click Add spacer in the drop-down menu of the table header. image,
Create and save a spacer image. This spacer image is a 1 pixel × 1 pixel transparent image). Then set the properties of the table to: H (height) is 1 pixel (1 pixel), W (width) is the desired width (pixel value or percentage can be entered), enter 0 in cellpad, cellspace, and border, and then Select the desired color in Bg Color (background color), and the colored horizontal thin line is inserted.
If you increase the H value, the line will become thicker. If you want to insert a colored vertical thin line, set H to the desired height value, set W to 0, and other settings are the same as above to insert a vertical thin line. In the web page editing window, the color is still gray, but press F12 to preview and you can see in the browser that the color of the inserted thin line has changed to the color you want.