Click to See Complete Forum and Search --> : Requesting script to stop background image tiling in table cell


iainwatt64
02-24-2006, 06:59 AM
Hi Everybody,
I have a backgound image sized to fit a single table cell within my page and want to stop that image tiling when the page is viewed at a larger screen size. The code I'm using to try to do it is:
<style type="text/css">
<!--
font {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-style: normal;
font-weight: normal;
color: #000000;

}
background {
background-image: url(images/vertnex.gif);
background-repeat: no-repeat;
background-position: center center;


}
-->
</style>

I've looked all over (extensively through this forum), and haven't found an answer. Can anyone help?
Thanx in advance,
iainwatt64.

pcthug
02-24-2006, 07:22 AM
font and background are not set HTML elements/tags, therefore these styles must be applied to a specific class/id which is then called upon by the table cell:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>I am a title</title>
<style type="text/css">
<!--
.style {
color: #000;
background: url(images/vertnex.gif) no-repeat center center;
font: normal 10px Verdana, Arial, Helvetica, sans-serif;
}
-->
</style>
</head><body>

<table>
<tr>
<td class="style">
No tiled images to be found here!
</td>
</tr>
</table>

</body>
</html>

iainwatt64
03-07-2006, 04:03 AM
Problemmo now solved, infinite thanks to PCThug. Only glitch was font formatting disappeared using that specific code, but easily resolved by reverting to former font style code and keeping ".style" to stop image tiling. I bow down before your wisdom, iainwatt64.