473,411 Members | 2,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Re Peating background

115 100+
hi all

this is my first attempt at making a repeating background work, for some reason it doesn't but i believe it should.
I have included the CSS in to my code and the image can be retrieved from the location it is in because i can display it as an image.

Code
Expand|Select|Wrap|Line Numbers
  1.  p   
  2.  {
  3.     background-image: url(~/image/RepeatBackGround.gif); 
  4.     background-repeat: repeat-x; 
  5.     }
  6.  
  7.  
the above code has been tried in the body tags with no such luck.

int the body tags
Expand|Select|Wrap|Line Numbers
  1. <p>boo boo boo boo boo boo boo boo boo boo boo boo </p>
  2.  
I know that the css file is linked correctly because i can state a background color in the CSS above and it works!

Any help is welcomed and appreciated

Truez
Mar 2 '09 #1
9 1666
drhowarddrfine
7,435 Expert 4TB
The browser won't know where ~ is so you must give the full pathname.
Mar 2 '09 #2
truezplaya
115 100+
when i do asp:image imageurl="~/image/RepeatBackGround.gif the image shows fine, And even if i do put a full path in it doesn't work :S
Mar 2 '09 #3
Dormilich
8,658 Expert Mod 8TB
what does the ~ stand for?
Mar 2 '09 #4
drhowarddrfine
7,435 Expert 4TB
Unix for the home directory. I don't recall if that works in Windows.

truezplaya, enter the pathname into your browser address bar and make sure the image shows up there. Or just 'ls /pathname/image/RepeatBackGround.gif' . Are you sure you have the letter case correct?
Mar 2 '09 #5
Dormilich
8,658 Expert Mod 8TB
@drhowarddrfine
the question is: does the browser know that, too?
Mar 2 '09 #6
drhowarddrfine
7,435 Expert 4TB
It does not, as I said above.
Mar 2 '09 #7
TheServant
1,168 Expert 1GB
I think the problem is that your images declared in your stylsheet need to be relative to that stylesheet. So because I keep all my stylesheet images in my 'css' folder along with my stylesheet I simply would have something like:
Expand|Select|Wrap|Line Numbers
  1. background-image: url(RepeatBackGround.gif);
But if I wanted to display the image on it's own, I would have to go:
http://mydomain/css/RepeatBackGround.gif

I think that should solve your problem.

PS - Didn't know about the "~"... I must test this!
Mar 3 '09 #8
truezplaya
115 100+
Hey up i managed to get it working.
I had made a very simple error.

background: transparent url(~/image/Vista.jpg) repeat;
When i looked i was using \ instead of / the code above would have worked but i retyped it just to show you what i was dealing with

cheers anyway

Truez
Mar 3 '09 #9
drhowarddrfine
7,435 Expert 4TB
Yes. Like everything, Windows has it backwards.
Mar 3 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

2
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...
3
by: Peter Williams | last post by:
Hi All, I want to write some javascript for a html page which does the following. Imagine that the page contains a table with 2 columns and 3 rows, e.g.: +---+---+ | A | B | +---+---+
5
by: proximus | last post by:
Hi, I am trying to change the background of table TD's. The problem is that I have no access to the HTML code. SO I am trying to alter this using Javascript/DOM in an external .js file. I...
3
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...
1
by: nicky77 | last post by:
Hi, I've created a nav bar using a background image for rollover effects. Everything works as I had hoped, however, for some reason it seems that an area of whitespace (the same size of the...
2
XedinUnknown
by: XedinUnknown | last post by:
Hi! I am new to this forum, but not new to web design and programming. Nevertheless, I have never tried to use PNG so extensively in my pages. here's the problem. First, I have found that the...
16
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...
10
by: VividWeb | last post by:
Hi. I am relatively new to CSS and HTML but have a basic understanding of most things. One of my backgrounds is not positioning correctly in IE 7 or AOL. The background behind the content...
2
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
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...

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.