faqts : Computers : Programming : Languages : JavaScript : DHTML

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

6 of 8 people (75%) answered Yes
Recently 2 of 4 people (50%) answered Yes

Entry

How do I add a border to a <LAYER> element in NN 4 ?

Jun 2nd, 2000 18:58
Mike Hall, Amit Mishra, Martin Honnen,


If you set a style on the LAYER tag, it will apply to the contents, not 
the layer itself. For example,
<layer bgcolor="#ff6600" 
 width=200 height=200
 left=100 top=100
 style="border: 2px; border-color: #000000; border-style: solid;">
Test
</layer>
will display an orange square with the word "Test" in the upper-left 
corner. The square will not have a border but the text will. That's 
probably not what you want.
Instead you can use nested tables to create a border effect. Try this,
<layer width=200 height=200 left=100 top=100>
<table bgcolor="#000000" border=0 cellpadding=2 cellspacing=0 width=200 
height=200><tr><td>
<table bgcolor="#ff6600" border=0 cellpadding=4 cellspacing=0 width=200 
height=200><tr valign="top"><td>
Test
</td></tr></table>
</td></tr></table>
</layer>
The outer TABLE defines the border, where cellpadding=2 sets the width 
of the border and bgcolor="#000000" makes it black. The inner TABLE has 
a bgcolor="#ff6600" to make the inner part orange. The 
width=200 and height=200 on both is necessary to make the tables and 
colors fill the layer.