473,831 Members | 2,462 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Gradient fill?

Hi all,

Here's another rank beginner question. What is the standard way to fill a
client-side table cell with a horizontal gradient background?

TIA - Bob

Aug 25 '08 #1
5 3449
Good afternoon Bob

There are several methods to create a horizontal gradient background for a
client-side table cell:

**** METHOD 1. Use CSS ****
If you're fine with restricting to IE then we can create gradients using
CSS filters (the Microsoft homepage did this for a long while): see
http://msdn.microsoft.com/en-us/libr...97(vs.85).aspx.
This only works for IE. It cannot be rendered by Firefox, Safari, etc.

However, some community members enhanced this solution by adding the
cross-browser support:
http://weblogs.asp.net/pleloup/archi...22/433775.aspx
<quote>
This has been tested and verified to work in MSIE6, Firefox 1.0.7, Safari
2.0.1, Opera 7.5 & 8.5 on Windows 2K, XP and OS X.
</quote>

Strength: We can dynamically define the gradient color range.
Weakness: The performance is relatively lower than METHOD 2

**** METHOD 2. Stretch a static image to fill the table cell ****
If you know what the start and end colors are in advance, we can pre-design
an image with the expected gradient color range, then load and stretch the
static image to the table cell.

Strength: Better performance.
Weakness: The background image need to be pre-designed, so we cannot
dynamically change the color range of the gradient effect.

By the way, some people may suggest using GDI+ to programmaticall y create
such an image in method 2 so that we can dynamically change the start color
and the end color. For example: http://www.devx.com/vb2themax/Tip/18733.
Please note that this is not an supported behavior. GDI+ is not supported
to be used in ASP.NET, ASP, or windows service. This may lead to some
unexpected results.
http://msdn.microsoft.com/en-us/libr...m.drawing.aspx

Please let me know whether the suggestions above are helpful to you. If you
have any other questions or concerns, DON'T hesitate to tell me.

Regards,
Jialiang Ge (ji****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/...tance&ln=en-us.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

Aug 25 '08 #2
""Jialiang Ge [MSFT]"" <ji****@online. microsoft.comwr ote in message
news:0p******** ******@TK2MSFTN GHUB02.phx.gbl. ..
Good afternoon Bob

There are several methods to create a horizontal gradient background for a
client-side table cell:

**** METHOD 1. Use CSS ****
[snip]
**** METHOD 2. Stretch a static image to fill the table cell ****
[snip]
Thanks Jialiang, that's just what I was looking for.
Aug 25 '08 #3

""Jialiang Ge [MSFT]"" <ji****@online. microsoft.comwr ote in message
news:0p******** ******@TK2MSFTN GHUB02.phx.gbl. ..
**** METHOD 2. Stretch a static image to fill the table cell ****
If you know what the start and end colors are in advance, we can
pre-design
an image with the expected gradient color range, then load and stretch the
static image to the table cell.

Please let me know whether the suggestions above are helpful to you. If
you
have any other questions or concerns, DON'T hesitate to tell me.
Hi Jialiang,

I posted a follow-up question over in the
microsoft.publi c.dotnet.framew ork.aspnet newsgroup (since this is an ASP.Net
question).
Aug 26 '08 #4
Hi Bob,

I've replied your follow-up question in the asp.net newsgroup. If you have
any other questions or concerns, please DON'T hesitate to tell me.

Regards,
Jialiang Ge (ji****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== ====
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=============== =============== =============== ====

Aug 26 '08 #5

"Bob Altman" <rd*@nospam.nos pamwrote in message
news:uS******** ******@TK2MSFTN GP02.phx.gbl...
""Jialiang Ge [MSFT]"" <ji****@online. microsoft.comwr ote in message
news:0p******** ******@TK2MSFTN GHUB02.phx.gbl. ..
>Good afternoon Bob

There are several methods to create a horizontal gradient background for
a
client-side table cell:

**** METHOD 1. Use CSS ****
[snip]
**** METHOD 2. Stretch a static image to fill the table cell ****
[snip]

Thanks Jialiang, that's just what I was looking for.
If you make the static image a transparent gray-scale gradient (.gif or
..png) with white as the transparent color, you can stretch it to fit inside
of a DIV with background-color set to anything you want -- thus giving you
dynamic choice of gradient color. (The only thing that remains static is
the pattern density of the gradient.)
-Mark
Aug 29 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4823
by: Thomas Kehl | last post by:
Hi! Does anyone have a tipp for me where can I found (or how can I programm) a "progressbar" which has a gradient and the color go from the left side to right and back ... I should have a waiting-progressbar :-) Thanks Thomas
5
2435
by: Woody Splawn | last post by:
I have a webform where I would like to have the background color for the webform be a gradient in blue. How do I do this? What is the easiest way? What is the way most used by other developers? Do you draw it with code or attach a .gif file as a background or what? Does one way or the other have an effect on speed? Thank You
5
4488
by: Dotnet Wanderer | last post by:
Hello Friends, Its time for me to show how cool UI can be in .NET. This is a call for help on how to create those beautiful looking gradient tool bars like this site: http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.dotnet.framework.aspnet I would appreciate any directions on how can I find information on these.
1
7542
by: Daniel Mark | last post by:
Hello all: I am using PIL to draw a rectangle filled with color blue. Is there anyway I could set the fill pattern so that the drawn rectangle could be filled with gradient blue? Thank you
2
1878
by: skylargivens | last post by:
I've created an application for Windows XP but I'm having trouble getting the right "look". I'd like my application to look somewhat like the Windows Vista sidebar: http://www.winsupersite.com/showcase/winvista_rc1_gallery_01.asp Notice how there is a black to transparent gradient on the right side of the screen. Does anyone know any way acheive this effect using Visual Studio 2005?
1
1662
by: madladuk | last post by:
Hi all. Does anyone have any example of how to do a gradient background whilst moving over graphics and text like the Microsoft web site. On the MS site when you select an area a window popup and as you hover over the sections it fill in a nice gradient background, any assistance? Thanks
6
6172
by: moondaddy | last post by:
I want to fill the entire background of a page with a gradient. As a test, I first filled with a solid color like this: <body style="background-color: #ccffff;" > and the entire page was this color. next I replaced that with a gradient style like this: <body style="filter:
2
2434
by: Mirco Attocchi | last post by:
Hi all, someone know how to fill with gradient a box or a field or entire column in detail section? Thanks Mirco Attocchi
9
8151
by: Eric Lindsay | last post by:
How do you provide a consistent gradient fill as a background in a liquid layout? If I make a gradient fill image say 1000 pixels wide (and repeat it down the page) to suit a typical computer display, then only a small portion of the gradient will show if the viewpoint is a smaller PDA or phone display. On the other hand, if viewed full screen on a 1920 pixel wide display, I would run out of gradient on one or both sides of the page....
0
9793
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9642
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10494
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10534
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10208
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5620
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5785
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3964
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3076
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.