Archive for the 'CSS' Category

The smell of HTML and CSS in the morning…

Saturday, November 21st, 2009

A few days ago, Jeffrey Zeldman said: I love the smell of HTML in the morning.

To which I replied: @zeldman I bet it smells like a good cup of coffee! ;-)

And Jeffrey replied: @optimiced How right you are.

This inspired me to quickly create the following illustration in Fireworks:

The smell of HTML (and CSS) in the morning

(NOTE: Coffee cup is re-created from scratch in Fireworks, although it looks like this illustration. The final appearance of my little drawing was also inspired by @molif, for which I’d like to thank her!:-)

A better, more accessible CSS way to hide outline from links

Friday, October 23rd, 2009

When starting a new project, I do not use global CSS resets — like Eric Meyer’s excellent CSS reset. That’s why, I rarely have problems with removed outlines from links.

As you probably know, users which do not use a mouse but navigate webpages with keyboard only, need to see outlines on links when they tab through them. This helps them visually understand which link they will activate.

A fairly new trend is to remove (suppress) this dotted outline on links to make pages look “nicer” to the eye. While design may look “nicer” and more “Web 2.0″ to some, when this outline is removed, the accessibility aspect of this remains, and it is very serious.

But Roger Johansson suggested a much better approach: remove links from :active state only!

This is the article that he recommends to all Web developers:

Better CSS outline suppression

Basically, what happens:

You remove the dotted outline from links which are only clicked with the mouse, while keyboard users will see the outline normally!

How? Just use this bit of code, and that’s it:

a:active {outline:none;}

Excellent tip!

I promise to myself that if I will ever try to remove the outline from links, I will do it in this, much more accessible way! :-)

“Jeffrey Zeldman is now following you on Twitter”

Monday, September 28th, 2009

…or how Twitter can be actually of some use;-)

{ Some drafts in my blog were hidden really deep, so… ;-) }

{ This story developed somewhere in July 2009… }

Twitter is an amazing… media? Social network? Means for ultra-fast transfer of news, wisdom, stupid things and “important” things like “I am drinking coffee now”? Something like IRC, but with an option for SMS, filtering, search, etc.?

Twitter is all of this simultaneously! :-)

Jeffrey Zeldman's hat…I am a Web designer and (partially) a geek, so it was very interesting for me to follow the discussion in two of the latest publications of Jeffrey Zeldman:

www.zeldman.com/2009/07/02/xhtml-wtf/
www.zeldman.com/2009/07/07/in-defense-of-web-developers/

…where the consequences of discontinuing the work on the XHTML 2 standard, and what will happen with XHTML 1.0, HTML 4.01, as well as with the new HTML 5, were passionately discussed.

At some point, in the Zeldman’s website, a strange bug appeared (in Firefox 3/Win): somewhere around 3/4 of the page with his last post and the numerous comments below, the content suddenly was disappearing (screenshot). Without a reason. The page itself was validating perfectly and there were no problems with the encoding or the HTML/CSS code.

Jeffrey noticed the problem, too, and was trying to solve it for quite a long time. The assumption that a problematic pingback with UTF-16 encoding was the culprit, was not confirmed.

I tried to investigate, too, out of curiosity, without any positive results, though.

Finally, I assumed that there’s a CSS bug in the rendering engine of Firefox/Win which (maybe) can be fixed with some new CSS rule. One of the readers of Zeldman’s blog mentioned that he tried to check something with Firebug, so I quickly made a test page + CSS file with the rule which (supposedly) was fixing this issue; then I tested in Firefox 3.0.11/WinXP. The problem was gone! :-)

Only one line fixed the problem for Firefox:

div#wrapper {
overflow: visible;
}

Then I’ve spent some more time to test in detail if the change did not affect any other popular browser (Opera 9.6, Safari 4, Chrome 2, IE7, IE6) and finally, I wrote to Zeldman, proposing him the fix for Firefox.

Zeldman replied:

@optimiced Will try as soon as I’m back on my feet. Thanks wise one.

Soon after that, Zeldman implemented the fix, and the design was fixed! :-)

Unfortunately, the fix introduced a new bug — the background of the page was “flashing” for a second or two on each page load because overflow: visible caused the background of the element #wrapper to load with a little delay (before: overflow: auto).

Well, after some more thought invested, I and another reader suggested two additional simple CSS solutions, which at a later stage proved to play very well together and fixed the “flashing problem” in all browsers — Firefox and Safari included! :-)

Last (but not least), I would like to say that Jeffrey Zeldman is a cool dude! After the whole story with the CSS bugs in Firefox and the red background flash was over, Jeffrey thanked me personally and added me to his Twitter list, and then promised to send me the new (third) edition of his popular book about Web Standards, as a present! (I think that somewhere in the CSS on zeldman.com there are some more acknowledgments hidden;-)

It’s always nice to communicate with such people, even if with messages only 140 characters long! ;-)

So, I am pleased to say, too: “Jeffrey, thank you!” :-)

* * *

Ah, and finally, why did I start this blog post with the question, what exactly is Twitter?

Because, after using Twitter for at least a few years, I can say that Twitter allows quick, precise communication in a new way. Comments in blogs, feedback forms, emails, allow us to communicate, too, but Twitter is something different. Something, which I cannot define precisely, but something, which fulfills its purpose and is also fun!

This is why you can (still) find me on Twitter (but you won’t probably find me on Facebook)… and, you can find me on my personal blog, of course! ;-p

XHTML 1.0 vs. HTML 4.01 (or HTML 5)?

Friday, May 15th, 2009

If you are a professional Web designer and create HTML/CSS code by hand for living, then you might be interested in the fact that Dave Shea switched from XHTML 1.0 to HTML 4.01.

It’s a fact that:

1) Lately, the HTML 5 standard gains up in speed.

2) XHTML 2.0 probably will never become a successor to XHTML 1.0. In fact, XHTML 2.0 probably will never exist at all.

3) Quite a few prominent Web designers and CSS/HTML coders are abandoning XHTML 1.0 and go back to HTML 4.01 (some of them even experiment very seriously with HTML 5).

What HTML standard for documents do you prefer? And am I the only one who (still) prefers XHTML 1.0 over HTML 4.01? :-)

It followed the interesting discussion at mezzoblue — I managed to read almost all of the comments there!

But, sometimes, it is not very clear to me as to where & why are going the Web Standards, guided by W3C.

After HTML 3.2, HTML 4.01 came, then the XHTML 1.0 standard was adopted, and now HTML 5 is developed? There’s almost no logic behind the versioning; plus, we have first the HTML language (which, in turn, derived from SGML), then W3C decided that it would be a great idea to combine XML + HTML (and so, XHTML 1.0 was ‘born’), and finally, they turn back to the idea of ‘pure’ HTML, and in the new standard (HTML 5), the ‘X’ is missing…

(more…)

The end of IE6 is soon?

Sunday, February 22nd, 2009

In the light of recent ideas that Web designers should spend less and less time, making fixes for Internet Explorer 6 (this browser is almost 10 years old already), I was curious to compare some browser stats for optimiced.com.

But first, a couple of words about the reasons why support for IE6 should be limited.

The Reasons

Dan Cederholm: How I Might Deal with IE6

Roger Johannson: No more pixel perfectionism in IE 6

Basically, the idea is as follows: Limit the time, which you dedicate to IE6, to the possible minimum. Yes, the design will look a bit different in this old browser, but so what? The important thing is that the design should work, and that there are no problems with the accessibility or functionality of the website.

In certain cases, you can even decide, if you wish to ensure a minimum support for IE6, or completely ignore it, in a similar way that Netscape 4.7x was ignored years ago, using the @import command for CSS styles.

For IE6, you can use IE conditional comments, like in this example:


<!--[if gte IE 7]><!-->
  <link rel="stylesheet" type="text/css" media="screen, projection" href="screen.css" />
<!--<![endif]-->

“Translated” to human language, this small piece of HTML code means the following:

If Internet Explorer is version 7 (or higher), the CSS file ’screen.css’ will be loaded. Otherwise, the file won’t be loaded (IE6 or lower). All other browsers (Firefox, Opera, Safari, etc.) will load the file screen.css quite normally. I have tested this in Firefox 3, Safari 3.2, IE7, IE6, and the code works perfectly.

Here’s the test example

Open this page in Firefox, Opera, Safari or IE7+ — the background of the page should be green, and it means that the ’screen.css’ file is loading normally.

Open the same page in IE6 (or even older version) — the background should be white, and it means, ’screen.css’ is not loading for it.

And now about my browser stats.

I decided to check, how many site visitors of my personal blog are using Internet Explorer, how many of them are using version 6, and also, how stand up the numbers for Firefox and a few other popular browsers of today.

The Numbers

As a base for my comparison, I took the last month (Jan. 22 — Feb. 22 2009), and I also compared this period with the same period, but 1 years ago (Jan. 22 — Feb. 22 2008).

Firefox (Jan. 22, 2009 — Feb. 22, 2009): 56.18% of all visits
Firefox (Jan. 22, 2008 — Feb. 22, 2008): 49.79% of all visits
Firefox: +6.39% increase in number of visits, during a period of 1 year

Internet Explorer (Jan. 22, 2009 — Feb. 22, 2009): 33.47% of all visits
Internet Explorer (Jan. 22, 2008 — Feb. 22, 2008): 40.90% of all visits
Internet Explorer: -7.43% decrease in number of visits, during a period of 1 year

At the present moment, Opera is around 5%, Chrome is around 3.2% and Safari around 1.5% (of all visits to my site). All other browsers (Mozilla, for example) have so low numbers, that they can safely be ignored.

The tendency is clear. Firefox slowly, but constantly is increasing its influence, while Internet Explorer makes exactly the opposite. Safari, Opera, and also Chrome, are present in the whole picture, but quite modestly. Firefox and IE are the “big players”, or at least, this is true for my blog visitors… :)

Now let’s see the numbers for the different versions of IE.

IE7/IE8 vs. IE6

IE7 (Jan. 22, 2009 — Feb. 22, 2009): 55.22% from the total share of IE in the stats
IE7 (Jan. 22, 2008 — Feb. 22, 2008): 41.59% from the total share of IE in the stats
IE7: +13.63% increase in number of visits during a period of 1 year

IE6 (Jan. 22, 2009 — Feb. 22, 2009): 43.64% from the total share of IE in the stats
IE6 (Jan. 22, 2008 — Feb. 22, 2008): 57.18% from the total share of IE in the stats
IE6: -13.54% decrease in number of visits during a period of 1 year

The trend here is also clear: IE6 slowly loses grounds, while IE7 is becoming more and more widespread.

IE8 Beta also appears in the stats, but the numbers are very low — around 1%.

The Verdict

Firefox: 56.18% from all visits to the website
Internet Explorer: 33.47% from all visits to the website
— IE7: ~ 55% (of all IE visits)
— IE6: ~ 43% (of all IE visits)

In total, my users, which are using IE6, are less than 15%. All others use Firefox, IE7, Safari, Opera and Chrome.

Is 15% too low a number, so I can apply the CSS “filtering” for IE6? No, it is too early for that, I think.

But I guess that in 1-2 years the share of IE6 will become so low, that there really won’t be any point in trying to fix the XHTML/CSS code for it.

And then IE6 will become history, in a much similar way that Netscape Navigator 4.7x became history a few years ago — something which made me very happy at the time! :-)

Most popular fonts on Windows, MacOS and Linux

Sunday, February 15th, 2009

If you are a Web designer and often write (X)HTML/CSS code, then the following list might be useful for you. In it, I have combined the most popular fonts on Windows, MacOS and Linux systems. The data is drawn from here and the stats are valid as of January 17th, 2009:

Windows:

Microsoft Sans Serif: 99.61%
Arial Black: 97.82%
Franklin Gothic Medium: 97.58%
Palatino Linotype: 97.54%
Verdana: 97.54%
Arial: 97.13%
Courier New: 96.96%
Comic Sans MS: 96.83%
Tahoma: 96.79%
Lucida Console: 96.76%
Impact: 96.49%
Trebuchet MS: 95.97%
Sylfaen: 95.00%
Lucida Sans Unicode: 94.34%
Georgia: 92.97%

Mac:

Monaco: 96.91%
Arial: 96.62%
Courier: 96.48%
Helvetica: 96.48%
Arial Black: 95.78%
Verdana: 94.37%
Georgia: 93.53%
Helvetica Neue: 93.07%
Trebuchet MS: 92.69%
Geneva: 92.41%
Courier New: 92.12%
Gill Sans: 91.58%
Comic Sans MS: 91.42%
Times New Roman: 90.58%
Arial Narrow: 90.44%
Apple Chancery: 90.15%
Skia: 90.15%
Lucida Grande: 90.01%
Futura: 89.73%
Hoefler Text: 88.47%

*nix:

DejaVu Sans Mono: 92.31%
Bitstream Charter: 90.77%
URW Chancery L: 89.87%
Nimbus Mono L: 89.35%
Century Schoolbook L: 89.09%

In bold above I have marked 7 font families in total. They are those fonts, which are found often on Windows and Mac (simultaneously), and these are (in mixed order):

1. Verdana (sans-serif font family)
2. Georgia (serif font family)
3. Courier New (monotype font family)
4. Arial (sans-serif font family)
5. Arial Black (sans-serif font family)
6. Trebuchet MS (sans-serif font family)
7. Comic Sans MS (sans-serif font family)

Unfortunately, none of these 7 fonts can be found among the most widespread fonts on Linux/Unix. Looks like I was wrong, when I assumed, that Verdana, for example, is one of the most popular fonts on Windows/Mac/Linux — the full stats show that Verdana is available on more than 90% of Windows/MacOS systems, but only on ~ 50% of the Linux systems…

More interesting conclusions can be made from the two available lists (short and long), for me it is enough to know that there are at least a few font families, which can be found on Windows and Mac systems at the same time.

Or, at least, your chances are quite high that one of these 7 fonts will be available… :-)

CSS Naked Day ‘2008

Wednesday, April 9th, 2008

Today, exactly at midnight, my blog (www.optimiced.com), as well as Ani’s blog (www.molif.com), are getting rid of their ‘clothes’.

Today is ‘CSS Naked Day‘ — the day which promotes Web Standards!

CSS Naked Day 2008 - getting naked with CSS styles... and not only CSS ;-) class=

This ‘CSS Naked Day’ is 24 to 48 hours long, and will show, that a blog or website with well written HTML+CSS can look pretty well even without its clothes (without its CSS styles).

So, if you see my blog without CSS today or tomorrow (without its design), don’t be puzzled by this fact — we ’stripped of’ our CSS styles for a good cause — and, as you can judge by the photo above (which we made together a few hours ago), not only of our CSS clothes, but also of our real clothes! (Read also a story at the Blogherald) ;-)

Long live Web Standards! :-D

CSS 3D effect

Thursday, March 6th, 2008

Step 1:

Open Silverback.

Silverback app (screenshot)

Step 2:

Resize slowly your browser window (Firefox, Opera, Safari, IE7 are all ОК) and…

Step 3:

…watch the effect. Cool!

There’s a discussion on how the quasi-3D effect was achieved using CSS + half-transparent PNG graphics — to me it reminds me the old video games; and looking at Steve, I instantly think of Nintendo’s Donkey Kong!

CSS rullz! ;-)

35 Designers by 5 Questions

Friday, April 20th, 2007

Smashing Magazine published today a very interesting article.

35 web designers were asked the following five questions:

  • 1 aspect of design you give the highest priority to.
  • 1 most useful CSS-technique you use very often.
  • 1 font you use in your projects very often.
  • 1 design-related book you highly recommend to read.
  • 1 design magazine you read on a daily/weekly basis (online or offline).

The answers? You can read them in the article itself:-)

CSS is Back

Saturday, April 7th, 2007

Optimiced.com - how it looked for over 48 hours :-)I put again my CSS clothes after stripping them off for more than 48 hours :)

Overall, this year’s CSS Naked Day was fun (my first participation, btw)

Over 1600 official participants this year (see the full list at: http://naked.dustindiaz.com)! But rather less noise than when the first CSS Naked Day came…

But I’m happy I was in :-)