Click to See Complete Forum and Search --> : Repeating image but not in background


vit
02-20-2009, 02:07 PM
I am using

<body>
.............................................
<div style="width:800px;background-color:CFECEC">
..............................................
</div>
</body>

so that my actual page is boardered (with wdth:..) and collored (with CFECEC).

How can I use a repeated small image instead of colloring, inside my page?

Not repeated image in background, like
<html>
<head><title>$title</title></head>
<!-- CSS -->
<style type="text/css">

body
{
background: url("$bgimage") fixed top,left;
}

p {font-family: courier}
input { background-color: #CCCCCC; }
</style>

<body>
...............
</body>

criterion9
02-20-2009, 02:33 PM
I think you mean that you want the image repeated in the background? Or am I misunderstanding your post? If so look up background-image on Google.

Jodarecode
02-20-2009, 02:41 PM
This will work tho you may want to specify height too.

<body>
.............................................
<div style="width:800px;background-image:url(somepic.jpg);background-repeat:repeat;">
..............................................
</div>
</body>

vit
02-20-2009, 02:45 PM
I think you mean that you want the image repeated in the background? Or am I misunderstanding your post? If so look up background-image on Google.

Sorry for not clearly formulated question.
If you look my first message I want to have a repeated image to serve like color inside my page.

criterion9
02-20-2009, 02:48 PM
So are you wanting it as a background image or are you wanting it to fill a particular space within the window or something? Its still not very clear whether you want a repeating background image or something else entirely.

vit
02-20-2009, 03:13 PM
Jodarecod,

This does not work

<body>
.............................................
<div style="width:800px;background-image:url(somepic.jpg);background-repeat:repeat;">
..............................................
</div>
</body>

Jodarecode
02-20-2009, 03:24 PM
I am using

<body>
.............................................
<div style="width:800px;background-color:CFECEC">
..............................................
</div>
</body>

so that my actual page is boardered (with wdth:..) and collored (with CFECEC).

How can I use a repeated small image instead of colloring, inside my page?

Let me see if I understand, You want an image to repeat inside the div tags to replace the coloring right?

If that's right then "background-image:url(somepic.jpg);background-repeat:repeat;" should be the answer, I already tested and works fine, what browser are you using?

you can add another div/table inside the div tags

if you want the image repeated like a border then use a table inside a table with the cellspacing set to what ever size in the first table along with:
style="width:800px;background-image:url(somepic.jpg);background-repeat:repeat;"

and then specify what ever color on the inside table.

vit
02-20-2009, 03:56 PM
Sorry, it works.
It required to indicate the full path for URL on my Tomcat on Windows (for files local path is OK ?).
But on the webhost server it should be the local path ./images/xxx.jpg

Do you know why, and can I do something that will allow me to have a local path for urls on both my local Windows server (my laptop) and on the webhost server.

rpgfan3233
02-20-2009, 05:29 PM
Sorry, it works.
It required to indicate the full path for URL on my Tomcat on Windows (for files local path is OK ?).
But on the webhost server it should be the local path ./images/xxx.jpg

Do you know why, and can I do something that will allow me to have a local path for urls on both my local Windows server (my laptop) and on the webhost server.

The './images/xxx.jpg' bit is a relative path, a fact of which I'm sure you're aware since you're running Tomcat. Make sure the directory that has your page in it has an images subdirectory. For example, the following should allow 'xxx.html' to find './images/xxx.jpg':
xyz:
images
xxx.html

xyz/images:
xxx.jpg

However, the following will NOT work:
xyz:
xxx.html

images:
xxx.jpg

Notice how 'images' is inside 'xyz' in the first example, but it is outside 'xyz' in the second example. Obviously './images/xxx.jpg' wouldn't work in the second example because 'xxx.html' is inside 'xyz', and 'images' is not.

If you're still unsure of the answer, post your directory structure, and we can figure it out. ^_^

vit
02-20-2009, 06:37 PM
My structure is:

C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\cgi\inex.pl

C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\cgi\MyDir\cgi_script.pl


C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\cgi\MyDir\image.jpg

Client -> http://www.....index.pl -> cgi_script.pl -> image.jpg

rpgfan3233
02-20-2009, 06:41 PM
If 'index.pl' is what is displayed by the browser, you would need to use './MyDir/image.jpg', not './image.jpg'.

vit
02-21-2009, 09:24 AM
If 'index.pl' is what is displayed by the browser, you would need to use './MyDir/image.jpg', not './image.jpg'.

Exactly, on webhost site. But by some reason it does not work on my local webserver and I need to indicate a full path:
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\cgi\MyDir\image.jpg

This is inconvenient, because when deploying a new version to a webhost I need to always think about changing a path.

What may be wrong with my Tomcat?