|
How to Use a Starburst on Your Web Page
By Stephen Bucaro
A "starburst" is a Web graphic that depicts a star or an explosion. Within
the starbust is some exclamatory advertising text like "Free!", "New!", or "Sale".
The starburst draws the viewers attention to the exclamatory advertising text.
A starburst can be entirely graphic, that is, the starbust and the text are
all in one graphic image. An entirely graphic statburst has the advantage
that it's easy to create, and you have complete control of the appearance of
the text. It has the disadvantage that, when you need to change the text, you
need to edit the graphic in an image editing program.
In this article, I show you how to use a starburst graphic with text that you
type in and it appears within the starbust. This has the advantage that you
can change the text without editing the graphic. This would be a great advantage
if you need to change the advertising text frequently, for example if a sale
price changes frequently.
Our method to accomplish this task is to use the starburst graphic as the
background image for a DIV element. The text will be placed within another DIV
element that is nested inside the DIV with the starburst background. We'll
use style to define the location and appearance of the text.
Shown below is the DIV with a starburst graphic configured as its
background.
<div style="width:129px; height:95px;
background-image:url('starburst035.gif');
background-repeat:no-repeat;
background-position: 0px 0px;">
</div>
In the DIVs style attribute, the width and height
properties are set to the same dimensions as the Width and height
of the starburst graphic.
Note - in this article, I’m placing the style code inline. Normally
style code is placed in an external file which is linked to the webpage. If
you're going to use only one instance of a starbust on your web site, then
inline style code is best. If you're going to use multiple instances of a
starbust, then external style code is best.
|