Reply
rgb function
Old 08-03-2007, 02:53 PM rgb function
Nathand's Avatar
Extreme Talker

Posts: 208
Location: USA
Hi, when I use "<body bgcolor="rgb(200,200,200)">" in Internet Explorer it works fine, as expected. But when I try and use it in Firefox the page always shows up as black? Is there a workaround for this?

Thanks,
Nathan
Nathand is offline
Reply With Quote
View Public Profile Visit Nathand's homepage!
 
When You Register, These Ads Go Away!
     
Old 08-03-2007, 03:29 PM Re: rgb function
bas
Super Talker

Posts: 107
Name: Bas
Location: Belgium
Using hexadecimal color-codes Works fine in all browsers, So rgb(200, 200, 200) would become #c8c8c8.
Code:
 <body bgcolor="#c8c8c8">
Or the better way with CSS:
Code:
 <body style=”background:#c8c8c8;”>
bas is offline
Reply With Quote
View Public Profile Visit bas's homepage!
 
Old 08-03-2007, 03:30 PM Re: rgb function
JamieLewis's Avatar
Pretty Much a Big Deal...

Latest Blog Post:
Gooie
Posts: 386
Name: Jamie Lewis
Location: UK
You could try using CSS, either in an external file(recommended) or inline. For inline CSS try putting:

Code:
<style>
body{
background:rgb(200,200,200);
}
</style>
in the head part of your document.

Or


Code:
<body style="background:rgb(200,200,200);">
in your code.

Hope that helped.

Jamie

Last edited by JamieLewis : 08-03-2007 at 03:47 PM.
JamieLewis is offline
Reply With Quote
View Public Profile Visit JamieLewis's homepage!
 
Old 08-03-2007, 03:40 PM Re: rgb function
bas
Super Talker

Posts: 107
Name: Bas
Location: Belgium
Quote:
Originally Posted by JamieLewis View Post
Code:
<body style="background:background:rgb(200,200,200);">
1x "background:" then , so:

Code:
<body style="background:rgb(200,200,200);">
bas is offline
Reply With Quote
View Public Profile Visit bas's homepage!
 
Old 08-03-2007, 03:47 PM Re: rgb function
JamieLewis's Avatar
Pretty Much a Big Deal...

Latest Blog Post:
Gooie
Posts: 386
Name: Jamie Lewis
Location: UK
Ha, blame my lack of thought while typing on that
JamieLewis is offline
Reply With Quote
View Public Profile Visit JamieLewis's homepage!
 
Old 08-03-2007, 06:48 PM Re: rgb function
Nathand's Avatar
Extreme Talker

Posts: 208
Location: USA
Great thanks. @bas - How do you get the hexadecimal color code from an rgb value?

Thanks again,
Nathand
Nathand is offline
Reply With Quote
View Public Profile Visit Nathand's homepage!
 
Old 08-03-2007, 08:40 PM Re: rgb function
LadynRed's Avatar
Super Moderator

Posts: 6,406
Location: Tennessee
Try this: http://www.pitt.edu/~nisg/cis/web/cgi/rgb.html

Converter here: http://www.javascripter.net/faq/rgbtohex.htm

RGB to Hex color picker tool: http://mediagods.com/tools/rgb2hex.html
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 08-03-2007, 09:00 PM Re: rgb function
Nathand's Avatar
Extreme Talker

Posts: 208
Location: USA
Thanks a lot.
Nathand is offline
Reply With Quote
View Public Profile Visit Nathand's homepage!
 
Old 08-03-2007, 09:49 PM Re: rgb function
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,024
Name: Forrest Croce
Location: Seattle, WA
Quote:
Originally Posted by Nathand View Post
Great thanks. @bas - How do you get the hexadecimal color code from an rgb value?
Hex color codes are RGB values. They're just expressed in a different format.

Pure red = rgb(255, 0, 0) = #FF0000
Pure green = rgb(0, 255, 0) = #00FF00
Pure blue = rgb(0, 0, 255) = #0000FF
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Reply     « Reply to rgb function
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.16846 seconds with 13 queries