background preloader

CSS2/DOM - Styling an input type="file"

CSS2/DOM - Styling an input type="file"
Page last changed today Credits wholly go to Michael McGrady, who invented this technique. A browser must support opacity to support this technique. A reader suggested adding a keyup event to the real input box so that you can copy the text the user types to the fake one. This page has been translated into Chinese and Italian. Of all form fields, the file upload field is by far the worst when it comes to styling. For a site I created I needed input fields like this one: The designer wanted the same styles, plus a "Select" image, to apply to all file upload fields. Ponder the differences. Screenshot: File input fields in the various browsers This is hardly what anyone would call a nicely designed form field. Also note Safari's fundamentally different approach. Fortunately, reader Michael McGrady invented a very neat trick that allows us to (more or less) style file upload fields. Without the technique your browser reacts like this: Now that looks much better, doesn't it? First Netscape 4.

40+ Useful Resources for Design Freebies Generally, any graphic designer looks out for the best and free resources in order to enhance their reputation among the huge crowd. The resources like PSD Files, Photoshop Brushes, icons, vectors, and textures are usually in huge demand which offers impressive results and also save a lot of time for the designers. With these resources, the graphic web designer adds more exposure to his site by promoting his services and products which attracts huge traffic to his website. In order to build their profile, the designers can choose the best resources from the numerous options available. One of the fastest ways to reach a stable position in your graphic career, you would need to choose some of the older fonts which keeps the contents exciting and fresh. To get a complete fullness of your design or to enhance the intricacy of your site, use Photoshop brushes. Free PSDs & Resources for Web Designers by Orman Clark Designmoo 365psd – Download a free PSD Dribbble Forrst Freebies Booth Icon Deposit

Styling A ScrollViewer/Scrollbar In WPF « Sacha's blog A while back I was looking at the Infragistics WPf showcase, Tangerine and I was quite jealous about the scrollbars that they managed to use. I mean styling a Button is one thing, but the ScrollBar is made of lost of nasty different control parts, (Part_XXX elements). Incidently I wrote an article about Part_XXX elements in a WPF article over at codeproject right here if you are interested. Anyways to cut a long story short I decided to try and have a go at Styling a bigger control such as ScrollViewer. And guess what I managed to do it. Hooray. This is what it looks like My Styled ScrollViewer Original ScrollViewer This blog entry outlines the steps I went through. Lookup and copy the original ScrollViewer and ScrollBar Templates from MSDN, for example Then I Pasted that code from MSDN into a Resources file in a WPF window. I then decided which parts I want to swap out.

WPF « Sacha's blog The other day we had a requirement to style a ContextMenu for our large WPF app. Now this sounds easy enough to do, and there are even some pointer on a Microsoft site which show you the alleged Styles applied to the standard controls, for the ContextMenu though, the example on the Microsoft site which is as follows: Turned out to be way wrong, you can clearly see that the screen shot below which uses the standard ContextMenu with no additional styling has a ScrollViewer to present items that do not fit in a certain amount of space. There clearly is no ScrollViewer in the Microsoft example shown above. So I thought ok, so I need to Style a ContextMenu myself, fine. Thing is this approach does not work for ContextMenu at all. mmmm So what can you do. I have this dummy one created: So lets assume you have a similar setup. Next I look at the selected Grid (“LayoutRoot”) properties, and I find its ContextMenu property, which is under the Miscellaneous group. Demo App:

Using JsonConvert.DeserializeObject to deserialize Json to a C# POCO class Tools for Formatting, Organizing and Sorting CSS Code If you are an uber-experienced web designer, you probably won’t have this problem. Your CSS files will be structured coherently and concisely, every selector will have been attentively placed, every property will be perfectly formatted… basically, your CSS will look like carefully crafted art. If this describes you, then move along please, this post is not for you. But if you are one of the 99.9% of web designers out there that work with CSS on a regular basis, it is for you. You know how it goes, you start a new web project with a barebones CSS file, and as you build the site your CSS grows rapidly with it. If only there was a bunch of tools that would help format, organize and sort my CSS for me. CSS Comb – Tool for sorting CSS properties in a specific order Usually to re-order CSS code you move lines over each other taking comments into consideration, multilines records of property values, hacks and everything that could be found in the real file. CSS Comb CSS Comb Online csscss GitHub

sass_and_less_compared.markdown Sass/Less Comparison In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax. For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different. Variables Both languages support scoped variable definition within a selector context. And their different output: Nested Selectors Sass and Less have the & selector that allows nested selector to refer to the parent scope. Mixins Mixins with Arguments / Dynamic Mixins Selector Inheritance Less does not provide selector inheritance. Colors Both less and sass provide color math. Sass provides a full array of tools for manipulating colors. Sass exposes a long list of color functions not found in CSS: Accessors: red($color)green($color)blue($color)hue($color)saturation($color)lightness($color)alpha($color) Mutators: Note: Less.js provides a number of similar color functions. Numbers Sass:

Speed Up Your Site with Delayed Content Speed remains one of the most important factors influencing the success of any website, and the first rule of performance (according to Yahoo!) is reducing the number of HTTP requests. Over the last few years we’ve seen techniques like sprites and combo CSS/JavaScript files used to reduce the number of HTTP requests. But there’s one area where large numbers of HTTP requests are still a fact of life: the small avatars attached to the comments on articles like this one. Avatars Many sites like 24 ways use a fantastic service called Gravatar to provide user images. <div><h4><a href=" src=" The Gravatar URL contains two parts. 100 is the size in pixels of the image we want. 13734b0cb20708f79e730809c29c3c48 is an MD5 digest of Drew’s e-mail address. So what’s wrong with avatars? These images aren’t critical to the page, and don’t need to be loaded up front. Delaying image loading HTML5 data what? Let’s see this in action

Related: