473,691 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

background image

Hi all,

I am using a background image via a stylsheet.

I've used this code: background-image:url("/images/tile.gif"); (which
I think is correct)

The image doesn't show up however, the path, the filename etc etc,
everything checks out ok.

Anybody an idea what might cause this ?
Erik Schulp
www.sgtclog.nl
eschulp@-houjerotzooimaa r-home.nl

-Let's all hope there is intelligent life on other planets,
cuz' here on earth, there is bugger all!- *Monty Python*
Jul 20 '05 #1
23 7718
In <34************ *************** *****@4ax.com> Erik Schulp <es*****@NOSP AM-home.nl> writes:
I've used this code: background-image:url("/images/tile.gif");


Ditch the quotes. Maybe add a space between "image:" and "url." The
following works for me:

background-image: url(http://localhost/rickshaw/graphics/logoback.gif);

--Dan

--
FREE scripts that make web and database programming easier
http://www.analysisandsolutions.com/software/
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7th Ave #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
Jul 20 '05 #2
*Erik Schulp* <es*****@NOSP AM-home.nl>:

background-image:url("/images/tile.gif");


That's correct syntax. To tell you more than that one needs to see more of
the code (CSS and probably HTML also), better yet give the URL and in which
browser[s] the image doesn't show up.

--
The Hitchhiker's Guide to the Galaxy: "To summarize: It is a well-known fact
that those people who must want to rule people are, ipso facto, those least
suited to do it. To summarize the summary: Anyone capable of getting themselves
made President should by no means be allowed to do the job. To summarize the
summary of the summary: People are a problem."
Jul 20 '05 #3
Christoph Paeper wrote:
*Erik Schulp* <es*****@NOSP AM-home.nl>:

background-image:url("/images/tile.gif");


That's correct syntax. To tell you more than that one needs to see
more of the code (CSS and probably HTML also), better yet give the
URL and in which browser[s] the image doesn't show up.


Without any other context than above; quotations around URLs in CSS,
though correct, can confuse some browsers.

--
Google Blogoscoped
http://blog.outer-court.com
Jul 20 '05 #4
Tim
On Thu, 18 Sep 2003 15:19:25 +0200,
Erik Schulp <es*****@NOSP AM-home.nl> wrote:
I've used this code: background-image:url("/images/tile.gif"); (which
I think is correct)
Do you mean something like:

body
{
background-image: url("/example.gif");
}

We don't know if you're trying it somewhere fancy that doesn't work, or
in the wrong way, or with a browser that doesn't support it.
The image doesn't show up however, the path, the filename etc etc,
everything checks out ok.

Anybody an idea what might cause this ?


Only with an example. There's too many variables in the equation.

--
My "from" address is totally fake. The reply-to address is real, but
may be only temporary. Reply to usenet postings in the same place as
you read the message you're replying to.
Jul 20 '05 #5
In article <34************ *************** *****@4ax.com>, eschulp@NOSPAM-
home.nl says...
Hi all,

I am using a background image via a stylsheet.

I've used this code: background-image:url("/images/tile.gif"); (which
I think is correct)

The image doesn't show up however, the path, the filename etc etc,
everything checks out ok.

Anybody an idea what might cause this ?
Erik Schulp
www.sgtclog.nl
eschulp@-houjerotzooimaa r-home.nl

body {background: #dadada url("./images/tile.gif") }

Note the . before the / No doubt someone will will say that it is not
necessary, but try it. It's how I always do it, and it works here. I've
heard the quotes are optional.
Don't forget that path/filename is case sensitive if your site is on a
*nix server.

--
Win98se, P200 MMX, 64MB RAM Opera7.20b11
Jul 20 '05 #6
Grayle <tt*****@ubgxrl .arg.nh> exclaimed in <MP************ ************@ne ws.hotkey.net.a u>:

[quoting Eric Schulp]
I've used this code: background-image:url("/images/tile.gif"); (which
I think is correct)

body {background: #dadada url("./images/tile.gif") }


Don't forget that path/filename is case sensitive if your site is on a
*nix server.


Oh, yes, filenames and paths are indeed case insensitive on Unix-family
computers, but the above is not a path - it's an URI. To boot, his URI

/images/tile.gif

points to a difference resource than your URI

./images/tile.gif

The syntax quoted:

background-image:url("/images/tile.gif");

is correct, if slightly compact and IMHO bad style. However, without
more information the only thing I can suggest is to remember that for
CSS stylesheets the base URI is that of the stylesheet, not that of
the document.

I doubt that matters here. We need more information.

--
- Tina Holmboe Greytower Technologies
ti**@greytower. net http://www.greytower.net/
[+46] 0708 557 905
Jul 20 '05 #7
ti**@greytower. net (Tina Holmboe) writes:
background-image:url("/images/tile.gif");

is correct, if slightly compact and IMHO bad style. However, without
more information the only thing I can suggest is to remember that for
CSS stylesheets the base URI is that of the stylesheet, not that of
the document.
Except in Netscape 4, of course - yet another bug.
I doubt that matters here.


Given the leading /, only if the CSS file is on a different host:port
combination to the page.
with mixed http and https pages.

--
Chris
Jul 20 '05 #8
In article <34************ *************** *****@4ax.com>, eschulp@NOSPAM-
home.nl says...
Hi all,

I am using a background image via a stylsheet.

I've used this code: background-image:url("/images/tile.gif"); (which
I think is correct)

Mikko's excellent post led me to actually have another look at this.

For good measure, we'll add three more cases, where the images are in
the root directory along with the HTML and the CSS.
One: url(tile.gif)
two: url(/tile.gif)
three: url(./tile.gif)
In an OFF-LINE environment ...
Opera7.2b11 and NN4.08 treat all six cases (ie; the first three plus
(images/tile.gif), (/images/tile.gif) and (./images/tile.gif)
identically and always displays the image called "tile.gif" in the sub-
directory called "images"
NONE of IE5.0, Mozilla/Firebird, Opera6.05, Opera7.02 and KMeleon0.7
display the image for case two/five, but they treat cases one/four and
three/six as identical and display the image correctly.

So - Nikolaos was mostly wrong when he suggested
background-image: url(/images/tile.gif)
NOTE: The lack of double quotes


because it only works in NN4 and a (possibly broken) beta of Opera, and
I was half-wrong when I suggested

(./images/tile.gif)

because although it works, it's unnecessary. (so Nikolaos was right
about that)

Mikko was correct when he said that (images ...) and (./images ...) were
functionally equal. Thanks Mikko - I can save two bytes every time I
point to something! I LIKE that.

Scores to date: Mikko 10 Grayle 5 Nikolaos 5
Now let us shift the CSS file into a subdirectory (say, /css), leaving
the HTML in
root and the images in /images.
For good measure, we'll add as case seven, (../images/tile.gif), which
is the only one that ought to work.

IE5, Moz/Firebird, Kmeleon, Opera6.05, Opera 7.02 and Opera7.2b11 find
the image if it
is addressed (../images/tile.gif) but not, as expected, in any other
case.
NN4.08 finds the image in cases one, three, four and six (NOT when
correctly addressed as above)
Remember all of the above are OFFLINE findings on MY machine.

Aaah buggerit. Go here -
http://www.hotkey.net.au/~ggboyle/wip/dottest.htm
and
http://www.hotkey.net.au/~ggboyle/wip/dottestdir.htm

--
Win98se, P200 MMX, 64MB RAM Opera7.20b11
Jul 20 '05 #9
Grayle wrote:
In article <34************ *************** *****@4ax.com>, eschulp@NOSPAM-
home.nl says...
Hi all,

I am using a background image via a stylsheet.

I've used this code: background-image:url("/images/tile.gif"); (which
I think is correct)

Mikko's excellent post led me to actually have another look at this.

For good measure, we'll add three more cases, where the images are in
the root directory along with the HTML and the CSS.
One: url(tile.gif)
two: url(/tile.gif)
three: url(./tile.gif)


If you want to talk cases then post URLs for each of your cases
otherwise as I said before please don't make mis-leading suggestions
unless you can back them up.

Post URLs and then we can all look at what you are talking about.

In an OFF-LINE environment ...
Right. And the reason for this is so that *nobody* can verify your
claims - In an offline environment anyone can claim anything.

This is already looking like its going to be a great rebuttle.

Opera7.2b11 and NN4.08 treat all six cases (ie; the first three plus
(images/tile.gif), (/images/tile.gif) and (./images/tile.gif)
identically and always displays the image called "tile.gif" in the sub-
directory called "images"
I think you are really missing the point here - the OP has *never* given
enough information to correctly determine what his problem is. He only
gave reference to a CSS rule with an absolute URL.

Where his CSS rule lies - within the html document or in an external
stylesheet in some folder is all speculation.

Since he does not give this information then we can't help him further
other than to suggest possible issues NOT related to location.

Christoph Paeper wrote: That's correct syntax. To tell you more than that one needs
to see more of the code (CSS and probably HTML also), better
yet give the URL and in which browser[s] the image doesn't show up.
As Tim wrote: We don't know if you're trying it somewhere fancy that doesn't work,
or in the wrong way, or with a browser that doesn't support it.
As Tina wrote: However, without more information the only thing I can suggest is
to remember that for CSS stylesheets the base URI is that of the
stylesheet, not that of the document.

I doubt that matters here. We need more information. ^^^^^^^^^^^^^^^ ^^^^^^^^^^
Are you getting the picture here....

Thus there are no cases at least none that the OP has provided and
really not much to talk about unless the OP wants to give further info.

If you want to start a new thread on what "your" cases then go ahead but
don't expect many replies unless you provide *online* URLs.

NONE of IE5.0, Mozilla/Firebird, Opera6.05, Opera7.02 and KMeleon0.7
display the image for case two/five, but they treat cases one/four and
three/six as identical and display the image correctly.

So - Nikolaos was mostly wrong when he suggested
Mostly wrong???? How do you determine that AND moreover about what.
Take a look at this URL:

http://www.solmar.ca/temp6/index.html

whose CSS is here:

http://www.solmar.ca/temp6/css/base.css

Do you see the lack of double quotes - Do you see the images.

Yes this works in IE 5 and IE 6 win, Opera 6.05 and Moz 1.3. Therefore
I have no idea what you are talking about. If the quotes are required I
would be happy to include them if someone can tell me what browsers it
does not work in - and yes I would like to see it for myself in an
ONLINE environment.

If you need to (a) put "./" in front of URLs to make things work for you
and you can (b) only provide test cases in an offline environment then I
think there may be something wrong with your system configuration.

background-image: url(/images/tile.gif)
NOTE: The lack of double quotes

because it only works in NN4 and a (possibly broken) beta of Opera, and
I was half-wrong when I suggested

(./images/tile.gif)
Half wrong. Most people with any real world CSS *hide* their CSS from
NN4 and really who cares if it works for a beta version of Opera (of
which you fail to mention a version for to boot).

How about totally wrong - and totally useless.

because although it works, it's unnecessary. (so Nikolaos was right
about that)

Mikko was correct when he said that (images ...) and (./images ...) were
functionally equal. Thanks Mikko - I can save two bytes every time I
point to something! I LIKE that.

Scores to date: Mikko 10 Grayle 5 Nikolaos 5
Scores??? For what - Hey Mikko your beating us ;-) At least I'm tied
with Grayle.... Wow. Where is the competition???? What's the prize????

Honestly, I asked you to provide online test cases and the only thing
you could do was reply to the OP with *non-tangible* test cases -

You may be right that things don't work without double quotes in an
offline environment but I honestly don't care to even try if you won't.

Now let us shift the CSS file into a subdirectory (say, /css), leaving
the HTML in root and the images in /images.

[snip]


Got tired of reading your cases that you don't have the courtesy to
provide a URL for....

Scores to date:

Mikko Doesn't matter Grayle *unknown* Nikolaos Doesn't matter

If you want to broaden your understanding then go ahead - if you want to
turn posts into a competition then please grow up.

--Nikolaos

Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5344
by: erik | last post by:
Is it posssible to inherit the previous pages (parent pages) background image? Is there a script out there I could look at? Thanks
2
10471
by: Markus Mohr | last post by:
Hi, everyone, I have a special problem: For every monitor resolution in 200 pixel steps from 800 to 1600 pixels I have an image to be shown as centered background-image. Those images all have the same name and reside in the following physical path structure:
27
13571
by: Kevin Yu | last post by:
When I declare on HTML page <LINK href="mycss.css" type="text/css" rel=stylesheet /> .... <BODY class=myclass> in mycss.css BODY { FONT-WEIGHT: bold; FONT-SIZE: 12px; FONT-FAMILY: Arial, Geneva; background-image: url(images/back.jpg); }
13
3962
by: Giggle Girl | last post by:
Hi there, I need to use a background image in a TR that does NOT restart everytime it hits a TD. Can it be done? Specifically, if you set a background image for an entier table, now mater how many TRs and TDs you have, it will show the complete/unfragmented image (as long as you don't over-ride it). When I set a TR background image, every time I hit a TD it "re-seeds" the image. I want to have a TR that shows an 800px image in it's
7
5123
by: Nilesh | last post by:
I am using background-image attribute in a CSS file and linking the CSS file to aspx page. But strangly, background-image attribute is not working for relative URL. e.g. If I apply following css ..navbar-background { background-image: url(images/menubar.gif); } the image is not appearing on the page. It seems that IE is picking
3
3232
by: Viken Karaguesian | last post by:
Hello all, I need somehelp with background tiling. I have a sneaking suspicion that what I want to do is not possible, but I'll ask anyway. :>) First some background: Here's the site in question: www.sayatnova.com (I'm sure many of you have seen this before as I've often asked for help). I've come a long way since I first created the site many moons ago and I'm trying to convert it to a (1) Table-less, (2) Frame-less and (3) Validated...
2
3072
by: Patrick | last post by:
Hi All, I am trying more and more to incorporate CSS into my work here. I have currently been playing around with fluid design and tableless layout. Currently I am trying to make a background image show up in a div that is designated by an id. The image is not appearing and after doing some googling I'm still a bit lost. Is it possible to display a background image in a div ID? Can someone school me a bit on this? I have supplied a...
6
7229
by: Rob | last post by:
Hello, I'm sure this has come up before. I have need for a collection of all elements/objects in an HTML document that have any kind of an attribute (HTML or CSS) that is making use of a URL to display an image. document.images only seems to reference image tags. The collection needs to include background images, input type = image, image maps, css assigned background, etc. Honestly, I am probably not aware of all the possibilities...
16
4929
by: stevedude | last post by:
CSS newbie again. I have a problem trying to get coffee mug images within anchor tags to center with my link text for a vertical list menu. If I use the horizontal/vertical properties of "background" or "background-image", the positioning only works with specifying pixels. If I specify the vertical position in pixels, the image gets cut-off at the bottom. I don't know what to do and would appreciate anyone's help. Specifically the code...
2
14070
by: thephatp | last post by:
I'm having a problem with IE rendering correctly. I'm experimenting with using all div's in my pages now, and I'm not very familiar with the quirks of IE. I have created a sample page, and I'm really confused as to what is going on in IE. FF renders the page exactly as I expect. IE renders the page with everything in the correct location, but it seems to double the background image for a sub-div section that is moved up using a negative...
0
8600
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8793
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8796
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6457
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5817
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4322
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4553
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2968
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
1954
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.