November 13, 2007

Text Shadowing in CSS/CSS2

Filed under: — Liz @ 8:28 pm

One day, Neil Crosby wanted to shadow some text using CSS. “So, the challenge was simple. Come up with some CSS which will produce drop shadows in as large a percentage of peoples’ web browsers as possible, leaving the browsers which are incapable of showing text shadows with unstyled text. Sounds simple? Well, for the most part, it was…

There are already tutorials out on the web which tell you how to produce text-shadows for various web browsers. The problem is, they all seem to focus on one particular browser, rather than producing a cross browser compatible solution. Of course, the “one true solution” is to wait until everything supports the CSS2 text-shadow property, but that day won’t come for a good while yet. So, in the mean time, here’s how I put everything together into one package so that it all “just works”.
Start with a Safari

In a big break from tradition, I decided to start by writing the CSS Apple’s Safari web browser. But why would I do this? Although I generally start work on the Mozilla group of browsers, due to the fact that they have the highest usage of the browsers which have good CSS implementation, in this instance Safari implements the text-shadow CSS property staight out of the box. Sadly, at this time, Mozilla does not - hence the need for this article.

Anyway, the CSS needed for Safari is as follows:

.shadow {
text-shadow: #666666 5px 5px 5px;
}

If you’re using Safari, this text should have a nice soft shadow

In an ideal world, that’s where this article would stop. Unfortunately, as I said at the top, there’s a bit more of a challenge to go yet. But first, lets do the next easiest bit. ”

Read the full article to learn how to do shadow text in many browser types.


Compliance with WAI Accessibility Guidelines

Filed under: — Liz @ 8:28 pm

Mark Kaelin feels that accessibility is something that is within reach for all web developers. “The Internet, through the interface of the World Wide Web, has become an important factor in almost everyone’s life, at least those of us living in the developed world. Along with other twentieth-century technological innovations like the telephone, radio, television, and the automobile, the Internet and the Web have revolutionized how human beings interact with each other. Unfortunately, just like the aforementioned innovations, the Internet also fails to take into consideration those members of society contending with limited physical accessibility.

The Web was designed for people who could see, hear, move a mouse, and type on a keyboard. If you cannot perform one or more of those functions proficiently, functions so many of us take for granted, you will likely find navigating the Web a challenge to say the least.

To address the needs of this select group of people, the World Wide Web Consortium (W3C), through its Web Accessibility Initiative (WAI), has developed a set of guidelines and standards for Web site developers to follow that is intended to make accessibility more universal. While many developers will find compliance with all the provisions of the guidelines problematic, a measure of compliance can be accomplished with a minimum of additional effort, if you know where to look.”

Read the full article from the Tech Republic.


Animating PNG files

Filed under: — Liz @ 8:30 pm

While this article is directed towards cartoonists and online comic makers, there are still many valuable tips for anyone who would like to use animated PNG on their web sites.

“PNG’s strengths are well suited for online cartoons:

  • It can handle truecolor graphics (millions of different colors), while GIF can only display 256 different colors. Therefore PNG comics can look much more vivid than GIF comics.
  • PNG compression is lossless, which means that unlike JPEGs, there is no degradation of image quality when you save a cartoon. You won’t see the color “halos” or blotches that mar many JPEG cartoons.
  • PNG is an Open Source image format, so you can use it however you want. GIF, on the other hand, uses a patented compression scheme which makes anyone using it subject to legal restrictions. Unisys, the company that owns this patent, can potentially force any GIF-using cartoonist to pay royalties. For a good rant on why cartoonists should use PNG instead of GIF, you can read an essay by Christopher B. Wright, creator of the Help Desk comic. An informative and political look at the issues can also be found at the Burn All GIFs website.
  • PNG images compress more efficiently than GIFs. The smaller file size you can achieve with PNG may be the most important reason to switch to this format. Nothing will make you lose readers like having strips that take too long to download. There are several ways to maximize this efficiency, which we’ll examine during most of this article.

In short, PNG combines (and improves upon) the best qualities of GIF and JPEG, and can effectively replace GIFs on the Web. So why don’t people use it more often? Maybe because of the misconception that modern Web browsers don’t support PNG. In fact, all major browsers can currently view PNG. If your readers use IE 4.0 or Netscape 4.04 or greater, they shouldn’t have any problems. I’ve also tested PNG images with several lesser used browsers, such as Opera, Amaya, and Mosaic, and they all work fine.

But enough of why you should use PNG- Here are some tips on how to use it correctly.”

Read all of the tips for creating animations and cartoons with .PNG image formats at PNG Tips for Cartoonists


Data Binding a ComboBox to Child Collection

Filed under: — Liz @ 8:37 pm

“One of the most frequent questions I get regarding data binding is how to hook up a combo box with a data bound list of selections from a related table or collection, and have selections in that combo box set a corresponding value in the related collection. For example, in the following form, the main collection is the Products table from Northwind. The textboxes are displaying a couple of the columns from that table, and the combo box is displaying the supplier name from the related Suppliers table. Products contains a foreign key column with a SupplierID that makes the link.

The code required to hook all this up in .NET 2.0 is very simple, although maybe slightly difficult to discover on your own. The solution below binds the controls to two BindingSource components, which is the new way of doing data binding in .NET 2.0. The BindingSource component provides a layer of indirection between your bound controls and their data sources that makes synchronizing bound controls easier, allows you to switch out the data source without needing to re-initialize bindings, and exposes a number of useful events to monitor what is going on in bound data sources in your code.

Basically all you need to do is get your data and set that as the data source on the two binding sources. Then set up a normal ComboBox data binding on the ComboBox with the DataSource, DisplayMember, and ValueMember properties.”

For a full set of instructions and a complete example, please see the full article on Brian Noye’s blog.


Basic Introduction to .PNG

Filed under: — Liz @ 8:39 pm

“For the Web, PNG really has three main advantages over GIF: alpha channels (variable transparency), gamma correction (cross-platform control of image brightness), and two-dimensional interlacing (a method of progressive display). PNG also compresses better than GIF in almost every case, but the difference is generally only around 5% to 25%, not a large enough factor to encourage folks to switch on that basis alone. One GIF feature that PNG does not try to reproduce is multiple-image support, especially animations; PNG was and is intended to be a single-image format only. (A very PNG-like extension format called MNG was finalized in mid-1999 and is beginning to be supported by various applications, but MNGs and PNGs will have different file extensions and different purposes.)

For image editing, either professional or otherwise, PNG provides a useful format for the storage of intermediate stages of editing. Since PNG’s compression is fully lossless–and since it supports up to 48-bit truecolor or 16-bit grayscale–saving, restoring and re-saving an image will not degrade its quality, unlike standard JPEG (even at its highest quality settings). And unlike TIFF, the PNG specification leaves no room for implementors to pick and choose what features they’ll support; the result is that a PNG image saved in one app is readable in any other PNG-supporting application. (Note that for transmission of finished truecolor images–especially photographic ones–JPEG is almost always a better choice. Although JPEG’s lossy compression can introduce visible artifacts, these can be minimized, and the savings in file size even at high quality levels is much better than is generally possible with a lossless format like PNG. And for black-and-white images, particularly of text or drawings, TIFF’s Group 4 fax compression or the JBIG format are often far better than 1-bit grayscale PNG.)

Like GIF and TIFF, PNG is a raster format, which is to say, it represents an image as a two-dimensional array of colored dots (pixels). PNG is explicitly not a vector format, i.e., one that can store shapes (lines, boxes, ellipses, etc.) and be scaled arbitrarily without any loss of quality (generally speaking). For that you probably want SVG or PostScript. (There are some private extensions to PNG that add vector information in addition to PNG’s regular pixels–Macromedia’s Fireworks does something along those lines–but no valid PNG may omit the pixel data.)”

Read the full introduction to PNG with information on compression and interlacing.


Using CSS2 to Create Printer Friendly Pages

Filed under: — Liz @ 8:48 pm

If you’ve been thinking about adding printer friendly pages to your information web site, Jennifer Kyrnin has the solution for you. “There are several options:

  1. Make a copy of every page or article - and manually remove all the non-printer-friendly stuff.
  2. Use a (CGI, PHP, JavaScript, other) script to remove the non-printer friendly stuff on the fly.
  3. Write a style sheet for print.

The drawback to option one should be fairly obvious to most people. It is very labor intensive and requires that for every page on your site, you create a second, duplicate page.

Option two is the most common choice right now, because it mitigates the problems of option one, and with a small change in how you write your Web pages, you can set it up for every page on your site. But if you don’t have access to CGI or you just don’t feel comfortable with programming, this method can be challenging, if not impossible.

Cascading Style Sheets to the Rescue

Luckily, CSS was not written with just Web pages in mind, and with just a few extra codes you can create a printer style sheet that removes all the non-friendly options on your page and even takes into account issues such as typography and readability. And you don’t have to write two different copies of your page or do any programming to build it.”

Read the full article hosted by About.com .


Creating Animated GIFs

Filed under: — Liz @ 8:51 pm

“If you’ve always wanted to create animated images from scratch, there are now simple ways to learn how even if you’re not a professional cartoonist. Animations work similar to cartoons because you must create a variety of images that are very similar, but different in just a small way. As the images are “flipped” or looped on the computer screen the animation comes to life.

Free animated gifs are available online, but sometimes you might need to create your own. For example, you might want to create a holiday special animation for your website to announce a special sale. There are many Christmas animated gifs available, but none of them have your company’s name or special offer on them. Once you understand how to create your own, you can customize them with your company name, your colors, logo, special offer, etc.

Choose a graphics program that’s easy to work with and affordable. Believe it or not, you don’t have to spend hundreds of dollars to get these great tools. There are graphic design programs available for less than a hundred dollars that will work just fine!”

There’s much more to it, but it’s not as difficult as it looks at first. Read the rest of this free tutorial for full instructions.


Data Binding to an Enumeration

Filed under: — Liz @ 8:51 pm

Paul Stovell gets development questions and he’s not afraid to answer them. “I recieved an email this morning as from Steve Pietrek, a Delphi programmer moving to .NET (great choice Steve!). His question essentially asked how would he go about binding a Windows Forms ComboBox to an enumeration such as this:

public enum CustomerType {
Type1 = 1,
Type2 = 2,
Type3 = 3
}

Fortunately, I figured out how to do this in Trial Balance about a week ago, so I thought I’d share my approach here.

The values in an enumeration (Type1, Type2, Type3 in this case) are all exposed as members on the enumeration type, which means we can use .NET reflection to retrieve them:

private List ConvertEnumForBinding(System.Enum enumeration) {
List results = new List();

// Use reflection to see what values the enum provides
MemberInfo[] members = enumeration.GetType().GetMembers();
foreach (MemberInfo member in members) {
results.Add(member.Name);
}

return results;
}

To bind to these results, you should simply need to write:

MyComboBox.DataSource = ConvertEnumForBinding(new CustomerType());

Easy huh? Unfortunately, it’s not quite that simple. ”

He goes into more details, fully answering Mr. Pietrek’s question at Paul Stovell’s personal Blog


What Is XSLT

Filed under: — admin @ 8:52 pm

Now that we are successfully using XML to mark up our information according to our own vocabularies, we are taking control and responsibility for our information, instead of abdicating such control to product vendors. These vendors would rather lock our information into their proprietary schemes to keep us beholden to their solutions and technology.But the flexibility inherent in the power given to each of us to develop our own vocabularies, and for industry associations, e-commerce consortia, and the W3C to develop their own vocabularies, presents the need to be able to transform information marked up in XML from one vocabulary to another.

Two W3C Recommendations, XSLT (the Extensible Stylesheet Language Transformations) and XPath (the XML Path Language), meet that need. They provide a powerful implementation of a tree-oriented transformation language for transmuting instances of XML using one vocabulary into either simple text, the legacy HTML vocabulary, or XML instances using any other vocabulary imaginable. We use the XSLT language, which itself uses XPath, to specify how an implementation of an XSLT processor is to create our desired output from our given marked-up input.

XSLT enables and empowers interoperability. This XML.com introduction strives to overview essential aspects of understanding the context in which these languages help us meet our transformation requirements, and to introduce substantive concepts and terminology to bolster the information available in the W3C Recommendation documents themselves.

Since April 1999 Crane Softwrights Ltd. has published commercial training material titled Practical Transformation Using XSLT and XPath, covering the entire scope of the W3C XSLT and XPath through working drafts and the final 1.0 recommendations. This material is delivered by Crane in instructor-led sessions and is licensed to other training organizations around the world needing to teach these exciting technologies.

Crane has rewritten the first two chapters of this material into prose. These prose-oriented chapters are published on XML.com correspondingly as two main sections. The material assumes no prior knowledge of XSLT and XPath and guides the reader through background, context, structure, concepts and introductory terminology.

Source : http://www.xml.com/lpt/a/619


Is XPointer too big?

Filed under: — admin @ 8:52 pm

In a minority opinion, Eve Maler and Paul Grosso suggest that “that XPointer would benefit from offering the option of a much more modest feature set.”

Maler and Grosso propose something much smaller than the complete XPointer proposal, “along the lines of our FIXptr proposal (W3C member only), that accords with the deployment and implementation patterns seen to date.”

FIXptr has apparently seen independent implementation, at much lower cost than full XPointer implementation:

“It may be worth noting that several of the vendors involved in XPointer’s development who are likeliest to be in a position to deploy it have no concrete plans to do so. Also, although no speed-of-implementation goal was ever set forth by the WG, we note that the single known complete implementation of XPointer took about two weeks, and the four known experimental implementations of the FIXptr proposal each took about half a day. Surely it is significant that getting four implementors to try the proposal on a casual basis was so easy, compared to the process of uncovering full XPointer implementations. And it appears that no users of the partial XPointer implementations today would lose any functionality if they were limited to FIXptr.”

One comment may be a warning regarding W3C development in general:

“The trend towards larger specifications is not merely inconvenient for developers; it can hamper implementation attempts, harm interoperability, and dampen enthusiasm for W3C’s work by users and developers alike.”

Source : http://www.xmlhack.com/read.php?item=1199


« Previous PageNext Page »

 
 
ERP systemen
Alle ERP-systemen op een rij, compleet met ERP-nieuws en ERP-software informatie.
www.ERPcentraal.nl
ERP systemen
Alle ERP-systemen op een rij.
www.erpmatrix.nl


Quick Links
Our Friends
Cool Places
Visit also
About Us