Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NO repeat in table cell background image

Status
Not open for further replies.

jassingh

Programmer
Mar 4, 2003
4
GB
I have a background image in a table cell(One of those gradient types). I have had to fix the width of the cell to teh width of the image to prevent it from showing the repeat.

Is there a way i can prevent it from repeating - if so can this be controlled to prevent horizontal tiling only - but allow vertical tiling.
 
Syntax

HTML { background-repeat : sRepeat }
Scripting object.style.backgroundRepeat [ = sRepeat ]

Possible Values

sRepeat String that specifies or receives one of the following values.repeat Default. Image is repeated horizontally and vertically.
no-repeat Image is not repeated.
repeat-x Image is repeated horizontally.
repeat-y Image is repeated vertically.


The property is read/write for all objects except the following, for which it is read-only: currentStyle. The property has a default value of repeat. The Cascading Style Sheets (CSS) attribute is not inherited.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see About Dynamic Properties.

Remarks

The repeat-x and repeat-y values make the image repeat horizontally and vertically, respectively, creating a single band of images from one side to the other.

This property can be set with other background properties by using the background composite property.

Examples

The following examples use the background-repeat attribute and the backgroundRepeat property to specify whether the background image is tiled.
This example uses a call to an embedded (global) style sheet to tile the image.

<STYLE>
.style1 { background-image:url(sphere.jpg);
background-repeat:repeat }
.style2 { background-image:url(sphere.jpeg);
background-repeat:no-repeat }
</STYLE>
</HEAD>
<BODY>
<SPAN onmouseover=&quot;this.className='style1'&quot;
onmouseout=&quot;this.className='style2'&quot; onclick=&quot;this.className=''&quot;>
. . . </SPAN>
&quot;did you just say Minkey?, yes that's what I said.&quot;

MrGreed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top