473,396 Members | 2,158 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,396 software developers and data experts.

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 3044
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.