Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming > Web Coding

Reply
 
LinkBack Thread Tools
Old 08-24-08   #1 (permalink)
1:14 Camera:People Ratio
 
Highly-Annoyed's Avatar
 
intel ati

Join Date: Jun 2005
Location: On CCTV
Posts: 1,953

Rep: 326 Highly-Annoyed is a proven memberHighly-Annoyed is a proven memberHighly-Annoyed is a proven memberHighly-Annoyed is a proven member
Unique Rep: 231
Folding Team Rank: 724
Trader Rating: 0
Default Gradient Backgrounds in IE/FF

Hi all,

I would like to set up a web page so that when it's loaded by IE, it gives me a gradiated background (although I have this sorted) but when it's loaded by FF, it shows a flat colour of my choice.

So:

IE: Gradiated.
FF: Flat colour of my choice.

Essentially I want the page to default to a flat colour when FF can't load the DXImageTransform.Microsoft.Gradient background, but I want to be able to choose that colour.

I know I can create a 1px wide Xpx high gradient using image editing software and have both browsers load a gradient and I may try that, but I wanted to try this first.

So, how can I get FF to default to a colour of my choice when it can't load the MS gradient?

Thanks .

Highly-Annoyed
__________________
.
Wise men speak because they have something to say; Fools because they have to say something. -Plato
Talk sense to a fool and he calls you foolish. -Euripides .. Terrifying are the weaknesses of power. -Greek Proverb
----—-—-————————————————————————————————————————————————
My Favourite Windows XP Freeware Page . ...' ..'. Wowza's Core 2 Duo Motherboard Analysis
----—-—-————————————————————————————————————————————————
OCN Camera Club
Nikon D300 | Tamron 17-50mm f2.8 | Tamron 90mm Macro f2.8 | 2X SB600 Speedlights

System: Details & Benchmarks
CPU
E6600 @ 3.2GHz (400x8)
Motherboard
Gigabyte EP45-DS3P
Memory
2GB DDR2-800 OCZ Gold Rv.2
Graphics Card
X1950PRO 512MB 621/1350
Hard Drive
700GB SATA300 Storage
Sound Card
Realtek HD Audio
Power Supply
Corsair TX 750W
Case
Antec SLK3700-BQE (Black)
CPU cooling
Custom Water Cooling
GPU cooling
AC2
OS
XP Home SP3
Monitor
17" LCD (Black/Silver)
Highly-Annoyed is offline I fold for Overclock.net Overclocked Account Highly-Annoyed's Gallery   Reply With Quote
Old 08-24-08   #2 (permalink)
Programmer
 
OasisGames's Avatar
 
intel

Join Date: Mar 2008
Posts: 178

Rep: 24 OasisGames is acknowledged by some
Unique Rep: 23
Trader Rating: 0
Default

Use the image, period. Using proprietary DOM interfaces is just plain stupid, especially when it causes you an obvious problem that you then need to solve.

Also, this should probably be in Web Coding.
__________________
Compiz-Fusion Developer
Ubuntu Alpha Tester

System: Acer Aspire 5610
CPU
Centrio Duo T2250
Motherboard
Acer "Grapevine"
Memory
1024MB
Graphics Card
Intel GMA 945
Hard Drive
Hitachi 120GB
Sound Card
Intel HD Audio
Power Supply
12V DC
OS
Ubuntu 8.10
Monitor
15.4" 1280x800
OasisGames is offline   Reply With Quote
Old 08-24-08   #3 (permalink)
Linux Lobbyist
 
lattyware's Avatar
 
intel nvidia

Join Date: Feb 2007
Location: England
Posts: 2,046

Rep: 225 lattyware is acknowledged by manylattyware is acknowledged by manylattyware is acknowledged by many
Unique Rep: 164
Hardware Reviews: 1
Trader Rating: 0
Default

The best thing is to make the graident a PNG image 1px wide, and then just set repeat: repeat-x; on it. That way it'll work in all browsers.

Otherwise, easiest way is to do the IE-only stuff in the IE conditional comment tags - look them up.
__________________
Lattyware | Main (Sig) Rig: gBOX42 | Lan Rig: gLAN42
Never been convinced by Linux? Here is a challenge. | Using LVM
Scratched Disc? | Guide To LAN Parties | Writing a GUI application in Python/Glade
Etching an image into your case. | Wireless Access Points: Easy wireless networking.
A Member Of The OCN Anime/Manga Club
There are three types of software. Free as in speech (FOSS), Free as in beer (Freeware) and Free as in BitTorrent.

System: gBOX42
CPU
Core 2 Duo E6600 @ 3.51GHz
Motherboard
Asus P5B Deluxe/WiFi-AP
Memory
2 x OCZ DDR2 Platinum 1Gb PC6400 C4
Graphics Card
256MB MSI 8600GTS
Hard Drive
2 x 500GB SATA (ST3500641AS), 250GB IDE, 200GB IDE
Sound Card
Creative Soundblaster Audigy SE
Power Supply
SEASONIC S12-600
Case
CoolerMaster Cosmos
CPU cooling
XSPC X2O Delta CPU Waterblock V2
GPU cooling
D-Tek FuZion GFX Block
OS
Arch x64 w/KDE4.1
Monitor
Dell 2407WFP, Dell E248WFP
lattyware is offline lattyware's Gallery   Reply With Quote
Old 08-24-08   #4 (permalink)
Photography nut
 
dangerousHobo's Avatar
 
amd nvidia

Join Date: Dec 2005
Location: ~/
Posts: 3,478

FAQs Submitted: 7
Folding Team Rank: 396
Trader Rating: 0
Default

If the gradient is a PNG and is going to have some alpha transparency then it will not work in IE6. You'd then need to use one of the work a rounds to fix it. Simple is better when it comes to front-end development.
__________________
"UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." - Doug Gwyn

Try out the latest Programming Challenge
Quote:
Originally Posted by Melcar
Only one reasonable way to solve this... a dance off.

CPU-Z Validation
@ 2.97-prime95 stable 16 hours @ 1.48v Proof | CPU-Z Validation @ 3.15


Getting Mouse Side Buttons to work in Linux, Compile a custom Kernel, More

System: Anomaly
CPU
Athlon 3700 SD(KACAE)0546 @3.02ghz
Motherboard
DFI UT nF4 Ultra-D
Memory
G.Skill 2x512 UTT(BH-5)
Graphics Card
evga 6800gs
Hard Drive
Maxtor 300GB + WD 250GB
Sound Card
onboard
Power Supply
Ultra 500w V-series
Case
one from Ultra
CPU cooling
Big Typhoon
GPU cooling
80mm fan mounted on
OS
Arch64 & Slackware 12.1
Monitor
Acer AL2216W 22" WS LCD

Last edited by dangerousHobo : 08-24-08 at 03:02 PM.
dangerousHobo is offline I fold for Overclock.net Overclocked Account dangerousHobo's Gallery   Reply With Quote
Old 08-24-08   #5 (permalink)
1:14 Camera:People Ratio
 
Highly-Annoyed's Avatar
 
intel ati

Join Date: Jun 2005
Location: On CCTV
Posts: 1,953

Rep: 326 Highly-Annoyed is a proven memberHighly-Annoyed is a proven memberHighly-Annoyed is a proven memberHighly-Annoyed is a proven member
Unique Rep: 231
Folding Team Rank: 724
Trader Rating: 0
Default

Quote:
Originally Posted by OasisGames View Post
Use the image, period. Using proprietary DOM interfaces is just plain stupid, especially when it causes you an obvious problem that you then need to solve.

Also, this should probably be in Web Coding.
Well, I'm not really sure what a "DOM interface" is... I don't have any kind of training or education in web creation, I just try to create something I want and usually just use whatever gets the job done, really. My knowledge is directly related to what I've done (as I've had to learn as I went), so it has many holes in it.

I use IE and so do most other people, so that's what I usually build my sites for. Usually they cross over in FF etc without too many troubles (as I don't do anything particularly complex) but from what research I've done, it appears that FF doesn't have anything equivilent to the "DXImageTransform.Microsoft.Gradient" code, for making a gradiated background, so all I end up with is a bright white background. What I'd prefer is if I had a black, or dark gray background.

All I really want is a snippet of code that says "if IE, then DXImageTransform.Microsoft.Gradient, if not IE than #000000" or some other colour. Usually most of this kind of stuff seems be able to be controlled with Javascript, which I don't know very well and tend to modify other people's freely available script, rather than write any myself, but perhaps something exists along these lines you know of?

As I said before though, I'm aware of the concept of creating a thin gradiated line in image editing software and having a browser repeat in over and over, but I wanted to try a solution like the one I've roughly outlined, rather than the image one. In fairness, I did deliberatly mention my awareness of the image gradiation solution in my post, so people wouldn't reply telling me about it... I'm really looking for the nuts and bolts of how to do what I've outlined, rather than being told about a solution I already know is superiour to the one I want to try, if it's possible.

If you don't know how to do what I want, that's fine, neither do I. I'll just keep looking until I either find out, or find it can't be done. In the case of the latter, I'll just use the image solution.

Quote:
Originally Posted by lattyware View Post
The best thing is to make the graident a PNG image 1px wide, and then just set repeat: repeat-x; on it. That way it'll work in all browsers.

Otherwise, easiest way is to do the IE-only stuff in the IE conditional comment tags - look them up.
Yeah, as above; I'm aware the image solution is most browser friendly, I just wanted to try doing it my way, if indeed my way is possible.

I don't know what the "conditional comment tags" are. I may well have used them, but without any kind of proper education in this field, I probably wouldn't know what they're called, even if I was using them... Still, you've given me something to go on I guess. I can always look it up and go from there.

As above, all I'm really after is some way for the page to:

Decided if the browser loading it is IE or not.
If it is IE, load the gradient.
If it's not IE, load a colour I specify as a background colour.

I'm sure there must be some script or other out there that can do this. It doesn't seem to be asking much really, from my amateur point of view anyway.

If either of you guys can help solve the problem in the way I want to solve it, than I'd be appreciative, if not, that's fine, I'll keep on searching until I hit the solution, or a dead end .

Thanks.

Also: MOD PLEASE MOVE THIS THREAD TO "WEB CODING". SORRY, MY MISTAKE. VERY TIRED

Highly-Annoyed
__________________
.
Wise men speak because they have something to say; Fools because they have to say something. -Plato
Talk sense to a fool and he calls you foolish. -Euripides .. Terrifying are the weaknesses of power. -Greek Proverb
----—-—-————————————————————————————————————————————————
My Favourite Windows XP Freeware Page . ...' ..'. Wowza's Core 2 Duo Motherboard Analysis
----—-—-————————————————————————————————————————————————
OCN Camera Club
Nikon D300 | Tamron 17-50mm f2.8 | Tamron 90mm Macro f2.8 | 2X SB600 Speedlights

System: Details & Benchmarks
CPU
E6600 @ 3.2GHz (400x8)
Motherboard
Gigabyte EP45-DS3P
Memory
2GB DDR2-800 OCZ Gold Rv.2
Graphics Card
X1950PRO 512MB 621/1350
Hard Drive
700GB SATA300 Storage
Sound Card
Realtek HD Audio
Power Supply
Corsair TX 750W
Case
Antec SLK3700-BQE (Black)
CPU cooling
Custom Water Cooling
GPU cooling
AC2
OS
XP Home SP3
Monitor
17" LCD (Black/Silver)
Highly-Annoyed is offline I fold for Overclock.net Overclocked Account Highly-Annoyed's Gallery   Reply With Quote
Old 08-24-08   #6 (permalink)
Photography nut
 
dangerousHobo's Avatar
 
amd nvidia

Join Date: Dec 2005
Location: ~/
Posts: 3,478

FAQs Submitted: 7
Folding Team Rank: 396
Trader Rating: 0
Default

Conditional comment tags

Code:
<head>
  <title>MyPage</title>
    <!--[if IE]>
       
    
    <![endif]-->
</head>
__________________
"UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." - Doug Gwyn

Try out the latest Programming Challenge
Quote:
Originally Posted by Melcar
Only one reasonable way to solve this... a dance off.

CPU-Z Validation
@ 2.97-prime95 stable 16 hours @ 1.48v Proof | CPU-Z Validation @ 3.15


Getting Mouse Side Buttons to work in Linux, Compile a custom Kernel, More

System: Anomaly
CPU
Athlon 3700 SD(KACAE)0546 @3.02ghz
Motherboard
DFI UT nF4 Ultra-D
Memory
G.Skill 2x512 UTT(BH-5)
Graphics Card
evga 6800gs
Hard Drive
Maxtor 300GB + WD 250GB
Sound Card
onboard
Power Supply
Ultra 500w V-series
Case
one from Ultra
CPU cooling
Big Typhoon
GPU cooling
80mm fan mounted on
OS
Arch64 & Slackware 12.1
Monitor
Acer AL2216W 22" WS LCD
dangerousHobo is offline I fold for Overclock.net Overclocked Account dangerousHobo's Gallery   Reply With Quote
Old 08-25-08   #7 (permalink)
Linux Lobbyist
 
lattyware's Avatar
 
intel nvidia

Join Date: Feb 2007
Location: England
Posts: 2,046

Rep: 225 lattyware is acknowledged by manylattyware is acknowledged by manylattyware is acknowledged by many
Unique Rep: 164
Hardware Reviews: 1
Trader Rating: 0
Default

Indeed.

I would seriously reccomend not designing for IE - design to W3C standards.

Firefox and IE are not the only browsers around. If you design to W3C standards, every browser other than IE will work, then just fix IE.
__________________
Lattyware | Main (Sig) Rig: gBOX42 | Lan Rig: gLAN42
Never been convinced by Linux? Here is a challenge. | Using LVM
Scratched Disc? | Guide To LAN Parties | Writing a GUI application in Python/Glade
Etching an image into your case. | Wireless Access Points: Easy wireless networking.
A Member Of The OCN Anime/Manga Club
There are three types of software. Free as in speech (FOSS), Free as in beer (Freeware) and Free as in BitTorrent.

System: gBOX42
CPU
Core 2 Duo E6600 @ 3.51GHz
Motherboard
Asus P5B Deluxe/WiFi-AP
Memory
2 x OCZ DDR2 Platinum 1Gb PC6400 C4
Graphics Card
256MB MSI 8600GTS
Hard Drive
2 x 500GB SATA (ST3500641AS), 250GB IDE, 200GB IDE
Sound Card
Creative Soundblaster Audigy SE
Power Supply
SEASONIC S12-600
Case
CoolerMaster Cosmos
CPU cooling
XSPC X2O Delta CPU Waterblock V2
GPU cooling
D-Tek FuZion GFX Block
OS
Arch x64 w/KDE4.1
Monitor
Dell 2407WFP, Dell E248WFP
lattyware is offline lattyware's Gallery   Reply With Quote
Old 08-26-08   #8 (permalink)
1:14 Camera:People Ratio
 
Highly-Annoyed's Avatar
 
intel ati

Join Date: Jun 2005
Location: On CCTV
Posts: 1,953

Rep: 326 Highly-Annoyed is a proven memberHighly-Annoyed is a proven memberHighly-Annoyed is a proven memberHighly-Annoyed is a proven member
Unique Rep: 231
Folding Team Rank: 724
Trader Rating: 0
Default

Quote:
Originally Posted by dangerousHobo View Post
Conditional comment tags

Code:
<head>
  <title>MyPage</title>
    <!--[if IE]>
       
    
    <![endif]-->
</head>
Excellent. Thank you very much. I'll give that a try .

Quote:
Originally Posted by lattyware View Post
Indeed.

I would seriously reccomend not designing for IE - design to W3C standards.

Firefox and IE are not the only browsers around. If you design to W3C standards, every browser other than IE will work, then just fix IE.
I'd love some figures on the usage breakdown of all internet browsers? What percentage don’t use IE? What percentage don't use IE or FF?

Still, I understand what you're saying makes sense and is good practice. I guess I just don't take web design very seriously . What exactly are the "W3C" standards? What exactly is "W3C"? If there are just a few rules to stick to, maybe it wouldn't hurt to try to encompass them when I next put a site together?

I have to say though, "W3c Standards" just summons an image of a massive dark-yellow book, filled with dull and tiresome rules, written using a dull and tiresome writing style and brimming with even more acronyms and abbreviations I don't know and that are unlikely to help fuel any creativity.

Still, I could be wrong, I just don't know. As I said, I usually just do whatever seems to work, I'm certainly no expert and no doubt many, if not all of the sites I've built over the years do not conform to various standards.

Still, feel free to link me. Perhaps there's a wiki?

Highly-Annoyed
__________________
.
Wise men speak because they have something to say; Fools because they have to say something. -Plato
Talk sense to a fool and he calls you foolish. -Euripides .. Terrifying are the weaknesses of power. -Greek Proverb
----—-—-————————————————————————————————————————————————
My Favourite Windows XP Freeware Page . ...' ..'. Wowza's Core 2 Duo Motherboard Analysis
----—-—-————————————————————————————————————————————————
OCN Camera Club
Nikon D300 | Tamron 17-50mm f2.8 | Tamron 90mm Macro f2.8 | 2X SB600 Speedlights

System: Details & Benchmarks
CPU
E6600 @ 3.2GHz (400x8)
Motherboard
Gigabyte EP45-DS3P
Memory
2GB DDR2-800 OCZ Gold Rv.2
Graphics Card
X1950PRO 512MB 621/1350
Hard Drive
700GB SATA300 Storage
Sound Card
Realtek HD Audio
Power Supply
Corsair TX 750W
Case
Antec SLK3700-BQE (Black)
CPU cooling
Custom Water Cooling
GPU cooling
AC2
OS
XP Home SP3
Monitor
17" LCD (Black/Silver)
Highly-Annoyed is offline I fold for Overclock.net Overclocked Account Highly-Annoyed's Gallery   Reply With Quote
Old 08-26-08   #9 (permalink)
Linux Lobbyist
 
lattyware's Avatar
 
intel nvidia

Join Date: Feb 2007
Location: England
Posts: 2,046

Rep: 225 lattyware is acknowledged by manylattyware is acknowledged by manylattyware is acknowledged by many
Unique Rep: 164
Hardware Reviews: 1
Trader Rating: 0
Default

The W3C are the ones that tell everyone what XHTML is, what XML is, what CSS is. Think of it this way, the W3C are the dictionary of the web world - they define what the langauges are and how code should be displayed.

I don't know exact percentages, but I'm pretty sure IE still controls half the market - that doesn't mean it is right as a browser.

http://www.w3.org is the W3C site.

Really, all you need to do is run your code through the validator and make sure it passes. If it does, then it means all web browsers should now, and in the future, render it properly. Obviously, not all browsers are perfect, but it's the best bet to create the best site possible, and you can add in code to fix it in browsers that fail (like IE).
__________________
Lattyware | Main (Sig) Rig: gBOX42 | Lan Rig: gLAN42
Never been convinced by Linux? Here is a challenge. | Using LVM
Scratched Disc? | Guide To LAN Parties | Writing a GUI application in Python/Glade
Etching an image into your case. | Wireless Access Points: Easy wireless networking.
A Member Of The OCN Anime/Manga Club
There are three types of software. Free as in speech (FOSS), Free as in beer (Freeware) and Free as in BitTorrent.

System: gBOX42
CPU
Core 2 Duo E6600 @ 3.51GHz
Motherboard
Asus P5B Deluxe/WiFi-AP
Memory
2 x OCZ DDR2 Platinum 1Gb PC6400 C4
Graphics Card
256MB MSI 8600GTS
Hard Drive
2 x 500GB SATA (ST3500641AS), 250GB IDE, 200GB IDE
Sound Card
Creative Soundblaster Audigy SE
Power Supply
SEASONIC S12-600
Case
CoolerMaster Cosmos
CPU cooling
XSPC X2O Delta CPU Waterblock V2
GPU cooling
D-Tek FuZion GFX Block
OS
Arch x64 w/KDE4.1
Monitor
Dell 2407WFP, Dell E248WFP
lattyware is offline lattyware's Gallery   Reply With Quote
Old 08-26-08   #10 (permalink)
1:14 Camera:People Ratio
 
Highly-Annoyed's Avatar
 
intel ati

Join Date: Jun 2005
Location: On CCTV
Posts: 1,953

Rep: 326 Highly-Annoyed is a proven memberHighly-Annoyed is a proven memberHighly-Annoyed is a proven memberHighly-Annoyed is a proven member
Unique Rep: 231
Folding Team Rank: 724
Trader Rating: 0
Default

Quote:
Originally Posted by lattyware View Post
The W3C are the ones that tell everyone what XHTML is, what XML is, what CSS is. Think of it this way, the W3C are the dictionary of the web world - they define what the langauges are and how code should be displayed.

I don't know exact percentages, but I'm pretty sure IE still controls half the market - that doesn't mean it is right as a browser.

http://www.w3.org is the W3C site.

Really, all you need to do is run your code through the validator and make sure it passes. If it does, then it means all web browsers should now, and in the future, render it properly. Obviously, not all browsers are perfect, but it's the best bet to create the best site possible, and you can add in code to fix it in browsers that fail (like IE).
LOL, I ran the following through the checker and it said I had three errors and two warnings...

Code:
<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  <title>IE Test</title>
  <meta name="description" content="">
  <meta name="keywords" content="">
  <meta name="author" content="">
  <meta name="generator" content="">
		 
<!--[if IE]>
<style>

body {filter:progid:DXImageTransform.Microsoft.Gradient(endColorstr='#FFFFFF', startColorstr='#000000', gradientType='0');}

</style>	
<![endif]-->

</head>

<body bgcolor="#000000">
		  
<table width="100%" height="100%" align="center" valign="middle" summary="" border="0">
<tr>
<td>		

<table align="center" valign="middle" summary="" border="0">
<tr>
<td><font color="#FFFFFF"><font size="+3"><b>THIS IS A TEST!</b></font></font></td>
</tr>
</table>	 	 


</td>
</tr>
</table>

</body>

</html>
Seems to work as I want in IE and FF though, regardless of errors, although I have no idea how correct it is...

Oh well, never mind .

Highly-Annoyed
__________________
.
Wise men speak because they have something to say; Fools because they have to say something. -Plato
Talk sense to a fool and he calls you foolish. -Euripides .. Terrifying are the weaknesses of power. -Greek Proverb
----—-—-————————————————————————————————————————————————
My Favourite Windows XP Freeware Page . ...' ..'. Wowza's Core 2 Duo Motherboard Analysis
----—-—-————————————————————————————————————————————————
OCN Camera Club
Nikon D300 | Tamron 17-50mm f2.8 | Tamron 90mm Macro f2.8 | 2X SB600 Speedlights

System: Details & Benchmarks
CPU
E6600 @ 3.2GHz (400x8)
Motherboard
Gigabyte EP45-DS3P
Memory
2GB DDR2-800 OCZ Gold Rv.2
Graphics Card
X1950PRO 512MB 621/1350
Hard Drive
700GB SATA300 Storage
Sound Card
Realtek HD Audio
Power Supply
Corsair TX 750W
Case
Antec SLK3700-BQE (Black)
CPU cooling
Custom Water Cooling
GPU cooling
AC2
OS
XP Home SP3
Monitor
17" LCD (Black/Silver)
Highly-Annoyed is offline I fold for Overclock.net Overclocked Account Highly-Annoyed's Gallery   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -4. The time now is 07:55 AM.