Featured Posts

Judging the CT Student Innovation Exposition (E-Commerce)... Want to know what the next 10 years will look like? Ask a high school student. Their creativity isnt limited by their knowledge of what we currently call technological limitations. They have a vision of...

Read more

The Value of Feeling Appreciated as an Employee in... Whether you’re a new employee or the vice president of the company, everyone wants to feel valued, even appreciated, in the workplace. Not only does it improve morale and make the workplace a more pleasant...

Read more

The difference between classic and motion tweens in... Here it is: If you're used to doing things "the cs3 way" then you can continue to do so with the classic tween tool. It works the same way as you remember, using key frames as normal, but you cannot...

Read more

PHP: If (equal to AND not equal) - eliminate form spam... Just learned a great function of PHP thats already made my forms a lot better. A while back I wrote an article about eliminating form spam without captchas by using css to hide a text input box for bots...

Read more

Drop Downs, Fly Outs, and Accordion Site Navigation: This last week I was in a meeting discussing a client site. It was a typical business meeting that was going into overtime on a Friday afternoon, and then things turned for the worst... someone suggested...

Read more

twitter

Breaking News

  •  

5 Ways to Reduce the Number of CSS Classes you use

Category : CSS, Slick Code, Technology

You can greatly reduce the number of css classes you use in a project by some best practices while writing or reviewing CSS code.

Use a CSS style Reset:
Browsers come with a default styling for most elements but unfortunately these definitions are not the same across all browsers. Even something as simple as a

tag can be interpreted differently across different browsers. (Bottom vs top margins in older versions of IE 6/7 vs FF and Chrome). Using a CSS reset makes all the default inherited definitions the same and will simplify your debugging while reducing the number of styles needed to account for different default element styling.

There are a number of resets you can find with a quick search. The most extensive is Eric Meyer’s reset, and this maybe a bit overkill as you will have to redefine all properties of every element. Experiment and see what works best for you and how you code. The CSS clear I use is attached below.

If you want to look into this further or if you want t help deciding which reset is right for you, a great article can be found from SixRevisions.

Create a Common CSS library:
Put all your generic one definition selectors in one place (generally the top as this will cascade better–more on this below.) If they only have one definition then you can very likely reuse the class elsewhere in the document. Keeping a generic name will allow you or someone else to easily understand the classes being used. Think float-left, float-right, clear-float, em, caption, highlight, center-text, center-auto, etc… I’ll list this out in another tutorial in the future.

I also declare all the colors used in a project as stand alone classes so I can quickly add them to a class without having to recreate a whole new class just to account for a change in text color.

I may not use the whole library in every project, but I use at least 75-80% and I know my commonly used code is there, and keeping all the colors in one placer makes it easier to copy and paste for other styles.

Cascade your CSS:
I start general and the work my way to being more specific. Using more specific selectors will allow you to drill down in setting properties. If you do this correctly you can greatly reduce the number of !important tags you use in your stylesheet.

CSS hierarchy: Element >> ID >> Classes >> !important >> DOM

Use Bug Killing CSS:
There will probably always be quirks among the many browsers creating the need for browser specific style sheets, but these style sheets should be as simple as possible. They should only list the properties for definitions that need to be overwritten to work in the given browser. Do not copy the entire rule. (I know this seems obvious-Its OK to laugh- but I’ve seen this on major websites).

Validate your CSS:
Don’t forget to use the w3c validation tools. This is the best way to spell check your style sheet in addition to checking syntax of all your elements. Plus, you’ll have the piece of mind knowing that your code is standards compliant.

SOPA Protest tomorrow. See you on Thursday.

Category : Around The Office, General Web Info, Politics, Social

This website will be “blacked out” in solidarity with the SOPA Protest for Thursday, January 18th, 2012. The internet needs to be protected in the same way as the press, and for the same reason.

If you’re just now learning about SOPA and Protect IP – scheduled to be voted on by the senate in the near future then you might want to do your research quickly – as over 30,000 websites will be down tomorrow to protest this ineffective, business killing, nanny-state, double speaking bill.

In the name of “internet security” aka (profit protection) the MPAA, RIAA, along with the Chamber of Commerce want to change the way the internet works from the router up. They want to be able to remove ANY website’s DNS listing because someone might have posted a link to a copyrighted material SOMEWHERE on the website. No court hearing to see if the plaintiff actually controls the rights, no appeal if they are wrong, no recourse for you to claim damages… just another way to frighten and kill competition from the same people who were VERY willing to sue single moms and students for downloading music and movies instead of adapting their business models to a new medium.

In case you didn’t already know Im talking about RIAA, MPAA, Chamber of Commerce, and an evil gang of media thugs (CBS, ABC, FOX, COMCAST, DISNEY, etc). These media thugs claim that there is a culture of thievery on the internet, and that may or may not be true, but what the forget to mention is that THEY CREATED THIS CULTURE – and whats more they PROFITED FROM IT.

CBS, for example, owns C|net, which was the exclusive distributer of Kazaa and Limewire in the mid 1990s and 2000s. C|net makes money every time someone downloads an application from them from referrals and advertising, sometimes up to $5 a download. With over 500 million downloads between just these two applications it’s safe to say they might have made more than a billion dollars creating this online culture. Now that phase I is complete they want to use this online community WHICH THEY FOSTERED AND PROFITED FROM as justification to rewire the internet in a way that coincidentally will make them even more money while creating unknown security and architectural problems for the rest of us.(http://www.filmon.com/cbsyousuck/)

Book Review: Responsive Web Design by Ethan Marcotte

Category : Uncategorized

In a short 140 pages Ethan Marcotte shows the future of designing for an internet which is device agnostic and platform independent. Gone are the days where you create a whole new markup for every new browser and screen type. Instead Ethan shows how we can leverage semantic code, screen types, and queries to overwrite rules for different CSS classes based on screen size.
Contunue Reading

Work on paper by Michael Madore

Category : Art & Design, Art Event

I stopped by the art gallery at 100 Pearl St to see the artwork of Michael Maddadore. The gallery is located within the lobby of 100 Pearl Street next to the Greater Hartford Welcome Center. No doubt some of the people who work in the building, some of which I know must have also seen some of this art, and other too, even if just in passing. I wish there was more traveling art in the corporate world.

Some of the work is marked as sold– bravo. Below is a shot of one of Mike’s pieces. Im glad to see other local artists working and living downtown.

Michael Madore
Gallery Hours: Mon-Fri, 8am-7pm.

Personally, I like it. Sure, Im his friend, but this shows a serious dedication and attention to detail. Its not a sprint, this is a marathon. Those lines are precise in their perspective and perfectly straight. Sure, use a ruler and you get the same effect – but this is a relatively large scale work, about 32 or 36″ tall, so a large amount of time went into this. There is a certain style to this that’s working and I like it. It rigidly adhering to rules of perspective in the foreground and center and throws it all those same rules out the window along the edge.