By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,659 Members | 940 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,659 IT Pros & Developers. It's quick & easy.

Non-tiled background images

P: n/a
Hey all,

I have found two seperate HTML codes which claim to stop background
images from being tiled. Neither of them seem to be working. I'm
writing my codes in Textpad, and use Internet Explorer 6 for my
browser.

Below you will find the two codes I've found. Can anyone tell me why
the hell they're not working?! This is driving me insane... moreso!!!!

<style>
<!--
BODY
{background-image: URL( your-image.gif);
background-repeat: no-repeat;
background-position: center;
background-align: middle;
}
-->
</style>
</HEAD>

I was instructed to place the following code into a style sheet

body { color: black; background: white url(foo.gif) no-repeat }

I would also quickly like to reiterate the fact that I'm so new to
this whole HTML world that newbie doesn't even come close to
describing me. And you can call me stupid on the condition you proved
me with an answer that fixes my problem!!! :-)

Thanks,
~L.
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
lo*****@ozconnect.net.au wrote:
I have found two seperate HTML codes which claim to stop background
images from being tiled.
That would be presentation, and therefore CSS' job, not HTML's. Followups
to comp.infosystems.www.authoring.stylesheets set.

Neither of them seem to be working. I'm writing my codes in Textpad, and
use Internet Explorer 6 for my browser.
Internet Explorer has many deficiencies, although as far as I know it
doesn't have any trouble with this part of CSS. It's usually easier to
have a high-quality browser such as Mozilla handy for your initial
development, and then place a few workarounds in your code to help the aged
Internet Explorer out a little.

Below you will find the two codes I've found. Can anyone tell me why
the hell they're not working?! This is driving me insane... moreso!!!!

<style>
You have invalid HTML. Before asking for help, please check your code for
errors. You can use the publically available free services provided by the
W3C for this:

<URL:http://validator.w3.org/>
<URL:http://jigsaw.w3.org/css-validator/>

<!--
BODY
{background-image: URL( your-image.gif);
background-repeat: no-repeat;
background-position: center;
background-align: middle;
}
-->
</style>
</HEAD>
That looks decent enough to me.

I was instructed to place the following code into a style sheet

body { color: black; background: white url(foo.gif) no-repeat }
That would also do the trick.

I would also quickly like to reiterate the fact that I'm so new to
this whole HTML world that newbie doesn't even come close to
describing me. And you can call me stupid on the condition you proved
me with an answer that fixes my problem!!! :-)


Being new to something doesn't mean you are stupid. There doesn't seem to
be anything majorly wrong with the code you posted. There may be something
else that is interfering, but as you haven't provided a URL to a testcase,
nobody is in any position to give further help. Whack a document up on the
web somewhere and post the URL.

Also, I think it's worth mentioning that I've seen the result of the
attitude of copying code without understanding how it works - you end up
knowing a few tricks here and there, and completely unable to help yourself
when something goes wrong or you need to do something new. I'd recommend
sitting down and reading a good HTML and CSS tutorial, and skimming through
the relevant specifications:

<URL:http://www.w3.org/TR/html401/>
<URL:http://www.w3.org/TR/REC-CSS2/>
--
Jim Dabell

Jul 20 '05 #2

P: n/a
lo*****@ozconnect.net.au wrote in message news:<u9********************************@4ax.com>. ..
Hey all,

I have found two seperate HTML codes which claim to stop background
images from being tiled. Neither of them seem to be working. I'm
writing my codes in Textpad, and use Internet Explorer 6 for my
browser.

Below you will find the two codes I've found. Can anyone tell me why
the hell they're not working?! This is driving me insane... moreso!!!!

<style>
<!--
BODY
{background-image: URL( your-image.gif);
background-repeat: no-repeat;
background-position: center;
background-align: middle;
}
-->
</style>
</HEAD>

I was instructed to place the following code into a style sheet

body { color: black; background: white url(foo.gif) no-repeat }

I would also quickly like to reiterate the fact that I'm so new to
this whole HTML world that newbie doesn't even come close to
describing me. And you can call me stupid on the condition you proved
me with an answer that fixes my problem!!! :-)

Thanks,
~L.

Can you define 'not working'. Is the image tiling regardless, or is it
just not appearing? From the code fragment you've given it might be
that you don't have the full path to the image, so the browser isn't
finding the image to render it.

Alternatively try this version:

BODY { background-position: center middle; background-image:
url(images/background.jpg); background-repeat: no-repeat }

peter stokes
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.