View Full Version : Background not repeat won't work
olivier78
04-01-2003, 06:02 AM
Hi all,
I have tried to stop my background from repeating, but to know avail... Can someone help me?
</head>
<body bgcolor="#cccccc" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">
<table width="100%" height="131" border="0" cellpadding="4" cellspacing="0">
<tr bgcolor="#FFFFFF">
<td width="25%" rowspan="2"> <a href="http://www.elantra.com.au" target="_blank"><img src="logoelantra.gif" alt="Home" name="image" width="200" height="110" hspace="0" vspace="0" border="0" style=""></a></td>
<td width="52%" height="88" background="topbannerhome.gif" background-repeat="no-repeat" bgcolor="#330066"><font color="#CCCCCC">
</font> </td>:mad:
Thanks!
Olivier
cg9com
04-01-2003, 06:09 AM
you can use CSS.
http://www.w3schools.com/css/default.asp
<style type="text/css">
table {
background-image:url(file.extension);
background-repeat:no-repeat;
}
</style>
add this snippet to your <head></head> and you can skip the image tag inside the table entirely.
you should visit the above link, CSS is very handy. :)
olivier78
04-01-2003, 06:24 AM
Thanks.. but... as you can see, I hve already put this in the page... And what I am trying to do is to include a background within a <TD>, which is working, but I don't want it to repeat....
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="writting" rel="stylesheet" type="text/css">
<style type="text/css">
</style>
</head>
<body bgcolor="#cccccc" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">
<table width="100%" height="131" border="0" cellpadding="4" cellspacing="0">
<tr bgcolor="#FFFFFF">
<td width="25%" rowspan="2"> <a href="http://www.elantra.com.au" target="_blank"><img src="logoelantra.gif" alt="Home" name="image" width="200" height="110" hspace="0" vspace="0" border="0" style=""></a></td>
<td width="52%" height="88" background="topbannerhome.gif" background-repeat="no-repeat" bgcolor="#330066"><font color="#CCCCCC">
</font> </td>
<td width="23%" bgcolor="#330066"> </td>
</tr>
<tr>
<td height="43" colspan="2" bgcolor="#FEB834"><font color="#CCCCCC"> </font></td>
</tr>
</table>
<br>
<table width="579" height="292" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<tr>
<th width="180" height="247" align="left" valign="top" nowrap background="frontpage.gif" bgcolor="#330066">
</th>
</tr>
<tr align="left" valign="top">
<td height="30" bgcolor="#330066"> <blockquote>
<blockquote>
<div align="right"></div>
</blockquote>
</blockquote>
<h2> </h2></td>
</tr>
</table>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="2" bgcolor="#CCCCCC">
<tr>
<td height="26" align="center" valign="middle" bgcolor="#FEB834"> ©2000-2003
elantra pty ltd </td>
<td align="right" bgcolor="#FEB834"><font size="2" face="Arial"><a href="http://www.elantra.com.au/abts.html">About
this site</a> Webmaster Help Disclamer </font></td>
</tr>
</table>
</body>
</html>
Thanks...
:confused:
cg9com
04-01-2003, 07:37 AM
Sorry, a little misunderstanding, but what i provided will work, of course you can change it.
<style type="text/css">
td.selector {
background-image:url(file.extension);
background-repeat:no-repeat;
}
</style>
Then in your table
<td class="selector">...</td>
any <td> with class="selector" will have the specific CSS, specified inside the <style> element.
you can also use an inline solution like so:
<td style="background-image:url(file.extension);background-repeat:no-repeat;">
i dont believe there is an attribute background-repeat="no-repeat"
Mhtml
04-01-2003, 07:57 AM
i dont believe there is an attribute background-repeat="no-repeat"
I was just about to say something about that :)..
It's almost as if you are attempting to use css as an attribute.
If you don't fully understand what cg9com has been telling you I think that you should check out http://www.w3schools.com/css ..
If you don't like having a block style sheet, just use it inline!
<td width="52%" height="88" background="topbannerhome.gif" style="background-repeat:no-repeat;" bgcolor="#330066"><font color="#CCCCCC">
[edit:]Sorry cg9com, didn't see that last inline example you had there!
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.