Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day (5th Edition)
Notice that all the frames in today's lesson have thick borders separating them. There are a number of attributes that can be set to control the appearance of frame borders or prevent them from appearing altogether. Start with the <frame> tag. By using two attributes, bordercolor and frameborder, you can turn borders on and off and specify their color. You can assign bordercolor any valid color value, either as a name or a hexadecimal triplet. frameborder takes two possible values: 1 (to display borders) or 0 (to turn off the display of borders). Note If you turn off the border, frames-compatible browsers won't display its default three-dimensional border. However, a space will still be left for the border. HTML 4.01 currently lists only the frameborder attribute. The bordercolor attribute qualifies as an extension. For example, the following code adds a deep red border (defined by #cc3333) around the middle frame in the frameset: <html> <head> <title>The frame Tag</title> </head> <frameset rows="*,*,*"> <frame src="/books/2/631/1/html/2/document1.html"> <frame frameborder="1" bordercolor="#cc3333" src="/books/2/631/1/html/2/document2.html"> <frame src="/books/2/631/1/html/2/document3.html"> </frameset> </html> Although HTML 4.01 doesn't provide either of these attributes for the <frameset> tag, you can use both of them to define default values for the entire frameset in current browsers. Of course, there's room for confusion when colored borders are defined. In the following frameset definition, a conflict arises because the two frames share a single common border, but each frame is defined to have a different border color with the bordercolor attribute: <html> <head> <title>Conflicting Borders</title> </head> <frameset frameborder="0" rows="*,*,*"> <frame frameborder="1" bordercolor="yellow" src="/books/2/631/1/html/2/document1.html"> <frame bordercolor="#cc3333" src="/books/2/631/1/html/2/document2.html"> <frame src="/books/2/631/1/html/2/document3.html"> </frameset> </html> In addition, the frameset is defined as having no borders, but the first frame is supposed to have a border. How do you resolve this problem? You can apply three simple rules:
Additional Attributes
Table 14.1 shows a few extra attributes for the <frame> tag. These attributes can give you additional control over how the user interacts with your frames. Other attributes control margins or spacing between frames and whether scrollbars appear when required.
|
Категории