If you are seeing this message, it is possible the page did not load properly. Please hit reload/refresh on your browser.
If you still see this message, you probably do not have a browser that supports web standards, although its content is accessible to any browser or Internet device.

Cool Tips & Tricks Cool Tips & Tricks

Help Communities:
Help Forums Bug Base
<< Prev Topic | Next Topic >>
Cool Tips & Tricks ::: HTML FAQ ::: (HTML Tip) Gradient Colors
New Topic    Add Reply
Topic: (HTML Tip) Gradient Colors  (?)  Click to receive email notification of replies Click to stop receiving email notification of replies email this topic to a friend
Nutrocker

ezboard Moderator
ezSupporter
Posts: 60
Posted: 10/11/01 2:02 pm    
(HTML Tip) Gradient Colors
By webpagedesigner

Here's a cool trick I learned at the Microsoft website as I was looking through some DHTML examples, they made a custom drop down menu and whenever you cursor would go over the item, it would be filled with a gradient (fading from one color to another). Like so....

Pretty cool huh?


Unlike that big old code that was used on Dynamic Drive to create that effect, this one is only a one or two line code!

<div style="width: 100%; filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1,StartColorStr=#DBCF23,EndColorStr=003399)">Pretty cool huh?</div>


HINTS ON USING CODE:


GradientType=1
Replace the 1 with a 0 for a vertical fade.
Keep the 1 where it is for a horizontal fade.

StartColorStr=#DBCF23
This is the first color in the fade. The color
I used was a yellow. Change as you wish.

End Color Str=#003399
This is the last color in the fade. The color
I used was a very dark blue. Change as you wish.

Edited by: atlass at: 12/15/01 4:00:08 am

  reply to this message

Nutrocker

ezboard Moderator
ezSupporter
Posts: 4794
Posted: 8/28/02 2:45 pm    
Re: (HTML Tip) Gradient Colors
Note: The above only works in IE


  reply to this message

Nutrocker

ezboard Moderator
ezSupporter
Posts: 5073
Posted: 9/23/02 2:02 pm    
Re: (HTML Tip) Gradient Colors
By using the span tag instead of div, you can make the span tag span 50% of the width and then use the span tag again imeediately after so that the colors merge.

<span style="width: 50%; filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1,StartColorStr=#0000FF,EndColorStr=#FFFF00)">Pretty cool huh?</span><span style="width: 50%; filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1,StartColorStr=#FFFF00,EndColorStr=#0000FF)">Pretty cool huh?</span>


Pretty cool huh?Pretty cool huh?


  
reply to this message

Nutrocker

ezboard Moderator
ezSupporter
Posts: 7264
Posted: 4/17/03 3:10 pm    
Re: (HTML Tip) Gradient Colors
Someone asked if gradients could be used within css? I got a surprise when they worked!

CSS
custom html area
1st text box from the top

 
<style type="text/css">

.mygradient {width: 100%; filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1,StartColorStr=#DBCF23,EndColorStr=003399) }


</style>


All you have to do is then give your html tag or tags a class, example of class for a span tag..

<span class="mygradient">hello world</span>


  reply to this message

Click to receive email notification of replies Click to stop receiving email notification of replies email this topic to a friend

New Topic    Add Reply

jump to:
Topic Control Image::: Topic Commands
<< Prev Topic | Next Topic >>

Icon Legend

reply button:::Reply to Post Button   edit button:::Edit Post Button  delete button:::Delete Post Button (Moderator Only)

subscribe/unsubscribe to thread button:::Subscribe to Thread Button   email to friend button:::Email to Friend Button  



- Cool Tips & Tricks - HTML FAQ -

Communitiesezboard Help Communities:

Help Forums Help Forums Bug Base Bug Base





Powered By ezboard® Ver. 7.32
Copyright ©1999-2007 ezboard, Inc.