You can define an inline frame with HTML tag .
The tag is not somehow related to tag,
instead, it can appear anywhere in your document. The tag defines a rectangular region within
the document in which the browser can display a separate document, including scrollbars and
borders. The src attribute is used to specify the URL of the document that occupies the inline
frame. Example Following is the example to show how to use the :
Document content goes here...
Sorry your browser does not support inline frames.
Document content also go here...
This will produce the following result: Document content goes here... Document content can
also go here... The Tag Attributes Most of the attributes of the tag, including name, class,
frameborder, id, longdesc, marginheight, marginwidth, name, scrolling, style, and title behave
exactly like the corresponding attributes for the tag. Attribute Description src This attribute is
used to give the file name that should be loaded in the frame. Its value can be any URL. For
example, 16. HTML – IFRAMES HTML 87 src="/html/top_frame.htm" will load an HTML
file available in html directory. name This attribute allows you to give a name to a frame. It is
used to indicate which frame a document should be loaded into. This is especially important
when you want to create links in one frame that load pages into an another frame, in which
case the second frame needs a name to identify itself as the target of the link. frameborder
This attribute specifies whether or not the borders of that frame are shown; it overrides the
value given in the frameborder attribute on the tag if one is given, and this can take values
either 1 (yes) or 0 (no). marginwidth This attribute allows you to specify the width of the
space between the left and right of the frame's borders and the frame's content. The value is
given in pixels. For example marginwidth="10". marginheight This attribute allows you to
specify the height of the space between the top and bottom of the frame's borders and its
contents. The value is given in pixels. For example marginheight="10". noresize By default,
you can resize any frame by clicking and dragging on the borders of a frame. The noresize
attribute prevents a user from being able to resize the frame. For example
noresize="noresize". scrolling This attribute controls the appearance of the scrollbars that
appear on the frame. This takes values either "yes", "no" or "auto". For example
scrolling="no" means it should not have scroll bars. longdesc This attribute allows you to
provide a link to another page containing a long description of the contents of the frame. For
example longdesc="framedescription.htm" HTML 88 All the HTML elements can be
categorized into two categories (a) Block Level Elements (b)Inline Elements. Block Elements
Block elements appear on the screen as if they have a line break before and after them. For
example, the
,
,
,
,
,,
,
, and
elements are all block level elements. They
all start on their own new line, and anything that follows them
appears on its own new
line.
Inline Elements
Inline elements, on the other hand, can appear within sentences
and do not have to appear
on a new line of their own. The , , , , , , , ,
,
[1.] , , , , , , , and elements are
[2.] all inline elements.
[3.] Grouping HTML Elements
[4.] There are two important tags which we use very frequently to group various other HTML
[5.] tags (i)
[6.] tag and (ii) tag
The
tag
This is the very important block level tag which plays a big role in grouping various other
HTML tags and applying CSS on group of elements. Even now
tag can be used to
create webpage layout where we define different parts (Left, Right, Top etc.) of the page
using
tag. This tag does not provide any visual change on the block but this has
more meaning when it is used with CSS.
Example
Following is a simple example of
tag. We will learn Cascading Style Sheet (CSS) in
a separate chapter but we used it here to show the usage of
tag:
17. HTML – BLOCKS
HTML
89
This is first group
Following is a list of vegetables
Beetroot
Ginger
Potato
Radish
This is second group
Following is a list of fruits
Apple
Banana
Mango
Strawberry
This will produce the following result:
THIS IS FIRST GROUP
Following is a list of vegetables
Beetroot
Ginger
Potato
Radish
THIS IS SECOND GROUP
Following is a list of fruits
HTML
90
Apple
Banana
Mango
Strawberry
The tag
The HTML is an inline element and it can be used to group inline-elements in an
HTML document. This tag also does not provide any visual change on the block but has
more meaning when it is used with CSS.
The difference between the tag and the
tag is that the tag is used
with inline elements whereas the
tag is used with block-level elements.
Example
Following is a simple example of tag. We will learn Cascading Style Sheet (CSS)
in a separate chapter but we used it here to show the usage of tag:
This is red and this is green
This will produce the following result:
This is red, and this is green
HTML
91
By default, your webpage background is white in color. You may not like it, but no worries.
HTML provides you following two good ways to decorate your webpage background.
Html Background with Colors
Html Background with Images
Now let's see both the approaches one by one using appropriate examples.
Html Background with Colors
The bgcolor attribute is used to control the background of an HTML element, specifically
page body and table backgrounds. Following is the syntax to use bgcolor attribute with
any HTML tag.
This color_value can be given in any of the following formats:
Example Here are the examples to set background of an HTML tag:
18. HTML – BACKGROUNDS HTML 92 This background is yellow
This background is sky blue
This background is green
This will produce the following result: This background is yellow This
background is sky blue This background is green Html Background with
Images The background attribute can also be used to control the background
of an HTML element, specifically page body and table backgrounds. You
can specify an image to set background of your HTML page or table.
Following is the syntax to use background attribute with any HTML tag.
Note: The background attribute is deprecated and it is recommended to use
Style Sheet for background setting. The most frequently used image formats
are JPEG, GIF and PNG images. HTML 93 Example Here are the examples
to set background images of a table.
This background is filled up with HTML image.
This will produce the following result: This background is filled up with
HTML image. Patterned & Transparent Backgrounds You might have seen
many pattern or transparent backgrounds on various websites. This simply
can be achieved by using patterned image or transparent image in the
background. It is suggested that while creating patterns or transparent GIF or
PNG images, use the smallest dimensions possible even as small as 1x1 to
avoid slow loading. HTML 94 Example Here are the examples to set
background pattern of a table:
This background is filled up with a pattern image.
This background is filled up with a pattern image.
This will produce the following result: HTML 95 Colors are very important
to give a good look and feel to your website. You can specify colors on page
level using
tag or you can set colors for individual tags using bgcolor attribute. The
tag has following attributes which can be used to set different colors:
bgcolor - sets a color for the background of the page. text - sets a color for
the body text. alink - sets a color for active links or selected links. link -
sets a color for linked text. vlink - sets a color for visited links - that is, for
linked text that you have already clicked on. HTML Color Coding Methods
There are following three different methods to set colors in your web page:
Color names - You can specify color names directly like green, blue or red.
Hex codes - A six-digit code representing the amount of red, green, and blue
that makes up the color. Color decimal or percentage values - This value is
specified using the rgb() property. Now we will see these coloring schemes
one by one. HTML Colors -Color Names You can specify direct a color
name to set text or background color. W3C has listed 16 basic color names
that will validate with an HTML validator but there are over 200 different
color names supported by major browsers. Note: Check a complete list of
HTML Color Name. 19. HTML – COLORS HTML 96 W3C Standard
16Colors Here is the list of W3C Standard 16 Colors names and it is
recommended to use them. Black Gray Silver White Yellow Lime Aqua
Fuchsia Red Green Blue Purple Maroon Olive Navy Teal Example Here are
the examples to set background of an HTML tag by color name:
Use different color names for for body and table and see the result.
This text will appear white on black background.
HTML Colors -Hex Codes A hexadecimal is a 6 digit representation of a
color. The first two digits(RR) represent a red value, the next two are a green
value(GG), and the last are the blue value(BB). A hexadecimal value can be
taken from any graphics software like Adobe Photoshop, Paintshop Pro or
MS Paint.