Page elements
Use the Text-align property to center the text in block-level elements. When Margin-left and Margin-right are set to auto, the element is centered relative to the parent element. However, some of the newer browsers that are popular today are not able to render this appearance correctly, such as IE5 and Netscape Navigator. If you use the th element in an HTML table, the contents of the cell are centered by default. On the basis of horizontal centering, you can center vertically and need to use the Position property. That
Position:abasolute;top:50%;left:50%;margin-top:xx;margin-right:xx;height:xx;width:xx;
The office-to-position allows the element to be removed from the document's current limit and displayed in any expected position.
If you want the horizontal line to be centered on the Safari browser, set Margin-left and margin-right to auto, but for Mozilla, Firefox, navigator, and IE, the margin setting is optional. When changing the color of the HR element, given the robustness of the Web page across browsers, you should set both the color and Background-color properties, because Ie/win only recognizes the color attribute of the HR element, while Safari, Mozilla, The Background-color property is supported by Firefox and Netscape Navigator 6+.
Summary of "CSS Cookbook" notes (iv)