Lifelesspeople.com

 Forum FAQsForum FAQs  Knowledge BaseKnowledge Base  RulesRules   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   HostingHosting   RegisterRegister 
 DonateDonate   WikiWiki   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

background image and colour

 
Lifelesspeople.com Forum Index -> Web Architects' Abode
Post new topic   Reply to topic View previous topic :: View next topic  
Author Message
Desbrina
Jadeite


Joined: 11 Jun 2005
Posts: 2958
Location: Earth

PostPosted: Wed Nov 21, 2007 5:15 am    Post subject: background image and colour Reply with quote

Is there a way to get it so that if images dont load, then it shows a background colour

I tired using both colour an image, but it didn't work

Code:
background: url(images/background.png);
   background:#000000;


The reason i'm asking is when i'm at college, i have images disabled, and because i used white text, i have to highlight the text in order to read it

Is there a way to do this
_________________
Midnight Tempest - A Sailor Moon TCG
Balanced Force - A Star Wars TCG
Back to top
 
nagisa_01
Novice Poster


Joined: 15 Sep 2007
Posts: 14
Location: Montevideo - Uruguay

PostPosted: Wed Nov 21, 2007 9:15 am    Post subject: Reply with quote

Well you are using the short notation of the background set of rules, i think it should have worked the way you wrote it, but you could try either to write the rule in the short notation or rule by rule, that would be the correct use of the css rule.
It would be as follow:

Code:
background: #000 url(images/background.png); /*#000 is a short version of #000000 */


Or rule by rule:

Code:
background-image: url(images/background.png);
background-color: #000;
Back to top
 
ClickFanatic
Est. 2005


Joined: 18 Jan 2005
Posts: 3857


PostPosted: Wed Nov 21, 2007 9:23 am    Post subject: Reply with quote

The background image is placed 'on top' of the background color.
If the background image is not available, then the background color (if specified) will be visible.

You can use the rules posted by nagisa_01. Note the difference in how the shorthand and the separate rules work.
_________________
Captain Jell-O Buster from the Future
[img]http://feeds.feedburner.com/sparepencil.1.gif[/img]
Back to top
 
Desbrina
Jadeite


Joined: 11 Jun 2005
Posts: 2958
Location: Earth

PostPosted: Wed Nov 21, 2007 3:02 pm    Post subject: Reply with quote

thanks to both of you. i hadn't realised i was using a short hand version, dreamweaver didn't tell me that
_________________
Midnight Tempest - A Sailor Moon TCG
Balanced Force - A Star Wars TCG
Back to top
 
Desbrina
Jadeite


Joined: 11 Jun 2005
Posts: 2958
Location: Earth

PostPosted: Wed Nov 21, 2007 4:47 pm    Post subject: Reply with quote

ok, i found a problem with adding both in, for the background image i'm using a transparent png

If i have images enabled, then the png isn't showing the body image

is there a way round this?
I know i can add transparencies to the actual divs, but then the text etc inside of the appears transparent
_________________
Midnight Tempest - A Sailor Moon TCG
Balanced Force - A Star Wars TCG
Back to top
 
ClickFanatic
Est. 2005


Joined: 18 Jan 2005
Posts: 3857


PostPosted: Wed Nov 21, 2007 4:54 pm    Post subject: Reply with quote

The description of your problem isn't very clear. Perhaps you could support it with some screenshots of what's going on?
_________________
Captain Jell-O Buster from the Future
[img]http://feeds.feedburner.com/sparepencil.1.gif[/img]
Back to top
 
Desbrina
Jadeite


Joined: 11 Jun 2005
Posts: 2958
Location: Earth

PostPosted: Wed Nov 21, 2007 5:10 pm    Post subject: Reply with quote

i'll try my best explaining it

When at home, i have images enabled, but at college they are disabled

Because the background image for the content and navigation divs is an 80% transparent dark grey png, with white text, when the images are disabled, i get white text on a white background, which i have to highlight to read

This is an image of what i want the page to be like when images are enabled
http://i5.photobucket.com/albu.....a/img3.png

as you can see from the image, the content and navigation are slightly transparent, letting the stars from the body background image show through

using the code nagisa_01 posted above, the page appears fine when images are disabled
http://i5.photobucket.com/albu.....a/img1.png

but the problem is when images are enabled
http://i5.photobucket.com/albu.....a/img2.png
As you can see from the image, there is no transparency in the content and navigation boxes

I hope I've explained it better
_________________
Midnight Tempest - A Sailor Moon TCG
Balanced Force - A Star Wars TCG
Back to top
 
ClickFanatic
Est. 2005


Joined: 18 Jan 2005
Posts: 3857


PostPosted: Wed Nov 21, 2007 5:27 pm    Post subject: Reply with quote

I see what you mean now. The problem is due to the fact that the image is placed above the background color. So the transparency is applied to a solid color... which means the background does indeed not show through.

There is not a perfect way to solve it, but I have an idea that might be a good alternative.

Create a background image for the content boxes with the starfield under a semi-transparent layer. In Photoshop or a similar layer based editor you can do this as follows: Open the starfield image. Open the PNG overlay image. Create a new layer on the starfield images. Copy the PNG overlay to the new layer and stretch to fit (or simply create a solid fill and change the layer transparency).
You will use this 'fake transparency' image as a background for the boxes. Due to the randomness of the starfield, you probably won't notice a 'break' in the background pattern.
_________________
Captain Jell-O Buster from the Future
[img]http://feeds.feedburner.com/sparepencil.1.gif[/img]
Back to top
 
Desbrina
Jadeite


Joined: 11 Jun 2005
Posts: 2958
Location: Earth

PostPosted: Thu Nov 22, 2007 2:03 am    Post subject: Reply with quote

thanks, worked perfectly
_________________
Midnight Tempest - A Sailor Moon TCG
Balanced Force - A Star Wars TCG
Back to top
 
Display posts from previous:   
Post new topic   Reply to topic    Lifelesspeople.com Forum Index -> Web Architects' Abode All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Home | Hosting | News | Forum | Links | System Status | About | Archive | Donate ]
Powered by phpBB © 2001, 2002 phpBB Group
All trademarks and copyrights on this page are owned by their respective owners. Posts and comments are owned by the poster. Everything else © 2001 - 2007 Lifelesspeople.com