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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No Repeat Background with a twist

Status
Not open for further replies.

Freemo

MIS
Oct 25, 2005
71
GB
Hello

I'm automating inserting backgrounds into web pages, so far i have been able to insert the following into the htm file and it works:

<body background="word.bmp">

The problem i have is that it repeats, what i don't need. The positioning is fine i just need it to show once. And i need the coding to be in the htm file not the css file.

Any help please. Been stuck for ages.
 
First of all using bmp's for websites: bad idea, they can be really huge, and some browsers don;t support them.

Second can't you just add a style tag to the body element:

Code:
<body background="word.bmp" style="background-repeat:no-repeat;">

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
You'll need to use CSS on this. You can use an inline style like
Code:
<body style="background-image: url('word.bmp'); no-repeat;">
I'd avoid .bmp format if possible.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Hello

Thanx for all your responses. Yes using a bmp isn't the best of plans, so i will be changing the format. Thanx for the tip.

Also tried out your ideas with no prevail. I can't really use the css file as my program automates the adding of backgrounds to the html file, so i would really like the coding to be in the html file.

If there is no way then there is no way and i would have to look at some how automating it to the css file, but if there is a way, it will save me a lot of time.

Thanx for your time so far.
 
so i would really like the coding to be in the html file.
You still can. Use the inline CSS examples that have been provided.



____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
... and invalid syntax.
Quite right - took too many shortcuts pasting that one together.

(Once again emphasizing the quote below) [blush]

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top