473,473 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

background images and divs

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 link to the test page below. I know the image is in the correct
directory because I can make it appear with a basic img tag.

http://ocg6.marine.usf.edu/patrick/test_css/test.html

Any help would be greatly appreciated.

Thanks,

Patrick

--
Patrick A. Smith Assistant System Administrator
Ocean Circulation Group – USF - College of Marine Science
http://ocgweb.marine.usf.edu Phone: 727 553-3334

The trouble with doing something right the first time is that nobody
appreciates how difficult it was. - La Rochefoucauld
Jul 20 '06 #1
2 3049
Els
Patrick wrote:
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 link to the test page below. I know the image is in the correct
directory because I can make it appear with a basic img tag.

http://ocg6.marine.usf.edu/patrick/test_css/test.html
You first set: background-image, and then "background:#FFF;

Just 'background', overrules all the other styles, since it's the
shorthand. Change it into background-color:#FFF; and the image
appears.

Or put it all in the shorthand instead, and save some bytes:
background: #FFFFFF url(backfilled-samp.jpg) no-repeat;
Note: Your image is grey. Best set the background colour also to that
colour, so that for instance white letters will still be readable in
case someone isn't seeing the background image.

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Jul 20 '06 #2
Els wrote:
Patrick wrote:

>>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 link to the test page below. I know the image is in the correct
directory because I can make it appear with a basic img tag.

http://ocg6.marine.usf.edu/patrick/test_css/test.html


You first set: background-image, and then "background:#FFF;

Just 'background', overrules all the other styles, since it's the
shorthand. Change it into background-color:#FFF; and the image
appears.

Or put it all in the shorthand instead, and save some bytes:
background: #FFFFFF url(backfilled-samp.jpg) no-repeat;
Note: Your image is grey. Best set the background colour also to that
colour, so that for instance white letters will still be readable in
case someone isn't seeing the background image.
Thank You Els,

That did the trick.

Next I am going to be trying to put a div in the center div and have it
align perfectly over the darker gray box in the background image and
have it stay there no matter how the user resizes their browser window.
The dark gray are of the background image was put there on purpose to
show me where to align the div to.

I'm sure I'll be back for more pointers, but I hope not.

Thanks again,

Patrick

PS Sorry to double post. I was originally trying to cross post to
another group but my server or mozilla wouldn't let me do it.
--
Patrick A. Smith Assistant System Administrator
Ocean Circulation Group – USF - College of Marine Science
http://ocgweb.marine.usf.edu Phone: 727 553-3334

The trouble with doing something right the first time is that nobody
appreciates how difficult it was. - La Rochefoucauld

Jul 20 '06 #3

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

Similar topics

13
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...
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...
3
by: blaq | last post by:
My latest project is almost done. It looks great in Firefox; I only have two IE bugs left to squash, yay! Please refer to http://www.blaqzone.com/Temp/Popfuel/ . Crib notes: - "reset.css" is...
1
by: laredotornado | last post by:
Hi, I'm trying to have a repeating vertical graphic that repeats all the way down my table except for the bottom 20 pixels, which I would like to be blank -- white, if white is the default BODY...
0
by: Jeb Hunter | last post by:
Well, how can I describe this succinctly? I have a page with DIVs that us background images to produce a border effect. It works perfectly well, but I want to make up (for now) 3 different...
3
by: seamlyne | last post by:
The first method I ever used for multiple state buttons was to create a graphic for each button for each state: AboutUs_on, AbooutUs_over, AboutUs_out, etc. That works great when there are just a...
4
by: Gary | last post by:
Hello, I want a background image to display in the extreme bottom right corner. What I have works fine in IE7 and FF2 not so in Opera 9.1 Any suggestions? Page Posted at the the link. ...
3
by: fletch | last post by:
I'm having a problem with my background image in DIVs. here is my code: CSS: #HeaderDiv { } #HeaderDivTopLeft
7
by: arupfrancis | last post by:
Hi, I am trying to create a colored box using background images. I am able to do it easily using tables but doing it in divs is proving to be an issue. Moreover IE and Mozilla also seems to be...
2
by: rigiditymodulus | last post by:
Hi - So, I had this working perfectly, then had a small crash (the transmitter for my wireless mouse occassionally freaks out my MacBook Pro) and when I rebooted and opened up my file the two...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.