In my site, in a table of particular I have to insert a image as background. I did that but the image looks like double image as the image is smaller than cell width and height it is getting overlap.
In background image cell I used no-repeat to end the repeat display of same image, but it is not working. I am designing web page using html in django framework.
template is
<td background="{{ STATIC_URL }}images/sample.JPG" no-repeat;>
May I know how to cancel the repeat display of same background image in a table cell.
Thanks
Look how I did it: In the template I put the following line:
<body id="bg" style="background-image: url('{% static "images/33.jpg"%}')";>
And in the css:
#bg{
background-size: 1800px 900px;
background-repeat: no-repeat;
background-position: top;
background-attachment: fixed;
}
As a result I obtained a fixed background and with the proportions of the screen.
'no-repeat'
is not a valid html attribute. Why aren't you using the style attribute OR a proper css included file?
<td style="background: url('{{ STATIC_URL }}images/sample.JPG') no-repeat;">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With