HTML and CSS Reference
In-Depth Information The src attribute
The value of the src attribute for the <frame> tag is the URL of the doc-
ument that is to be displayed in the frame. There is no other way to
provide content for a frame. You shouldn't, for instance, include any
<body> content within the frame document; the browser ignores the
frame tags and displays just the contents of a <body> tag if it comes first,
or vice versa.
The document referenced by the src attribute may be any valid doc-
ument or any displayable object, including images and multimedia. In
particular, the referenced document may itself be composed of one or
more frames. The frames are displayed within the referencing frame,
providing yet another way of achieving complex layouts using nested
Because the source may be a complete document, all the features of
HTML/XHTML apply within a frame, including backgrounds and colors,
tables, fonts, and the like. Unfortunately, this also means that multiple
frames in a single browser window may conflict with each other. Spe-
cifically, if each nested frame document (not a regular HTML or XHTML
document) has a different <title> tag, the title of the overall browser
window is the title of the most recently loaded frame document. The
easiest way to avoid this problem is to ensure that all related frame doc-
uments use the same title. The name and id attributes
The optional name attribute for the <frame> tag labels that frame for later
reference by a target attribute for the anchor ( <a> ) tag and the <form>
tag. This way, you can alter the contents of a frame using a hyperlink
in another frame. Otherwise, like normal browser windows, linked docu-
ments replace the contents of the source frame. We discuss names and
targets at greater length later in this chapter. [ The target Attribute for
the <a> Tag, 11.7.1 ]
Search WWH ::

Custom Search