When linking to external style sheets and using the title attribute, you have to be a bit careful. I'll explain to you how to correctly link to external style sheets.
Normally, you link to an external style sheet like this:
<link rel="stylesheet" type="text/css" href="/css/main.css"
media="screen,projection" />
Perfectly fine!
However, you'd like to add a print stylesheet to, using media="print":
<link rel="stylesheet" type="text/css" href="/css/print.css"
media="print" />
Now, this too works fine. However - when you want to use the title attribute with your style sheets, you have to be careful.
The title attribute is great to use if you want simple style switching and alternative style sheets. But you need to know what you do to get it to work!
In this code, the print style sheet will not work, it won't be triggered in different browsers:
<link rel="stylesheet" type="text/css" href="/css/main.css"
media="screen,projection" title="Default stylesheet" />
<link rel="stylesheet" type="text/css" href="/css/print.css"
media="print" title="Print stylesheet" />
It's because the print style sheet's title attribute has a value. If the value is removed, or the whole title attribute, the print style sheet will work.
This happens because there are three different types of style sheets - and if an external style sheet is of the wrong kind - this style sheet will simply be ignored.
Three different types of style sheets
The three types of style sheets are:
- Persistent, which is a kind of default style sheet. No title attribute is needed.
- Preferred, which is the style sheet web browsers apply. Title attribute is needed.
- Alternate, which is alternatives to already existing style sheets. Title attribute is needed.
If these are mixed up, things might not be working as expected. Here's more on specifying external style sheets.
Conclusion
If you want your style sheets to work, make sure they're of the correct style sheet type. This final example works very well:
<link rel="stylesheet" type="text/css" href="/css/main.css"
media="screen,projection" title="Default stylesheet" />
<link rel="stylesheet" type="text/css" href="/css/print.css"
media="print" />
It's now official, I have a new job and it's a great one - I'm going to Nansen!
I've had a great four years with my current employee, Hallvarsson & Halvarsson, but the time has come to move on.
I'll be working with system development and interface development at Nansen. A lot of .NET and EPiServer focus, exactly the way I like!
My first days at Nansen will be in September. Can't wait!
I recently bought myself a brand new Solid State Drive and re-installed Windows 7 plus all necessary programs. Here's my compiled list of the tools I can't live without.
Developer tools first
After a clean Windows 7 installation, I download Microsoft's Web Platform Installer, which is really useful for developers. It'll install all the tools necessary for .NET web developmentweb server as well as the latest .NET framework, SQL Server, plus much more if you want it to. Try it out, it'll save you a whole lot of time! Here's a blog post on how to install the .NET development tools you need.
No .NET environment is complete without Visual Studio though. I'm of course sticking with Visual Studio 2010.
Tools that improve my everyday computer usage
- 7-zip
- For file archives.
- xplorer2
- Great file explorer with dual panes. My explorer of choice since 2007 something.
- Foxit Reader
- Fastest pdf reader ever.
- TeraCopy
- Copy files faster. Improves speed a lot.
- J.River Media Center
- Music player totally worth the minor cost. Best ever.
- Paint.NET
- Free and fast Photoshop alternative.
- Picasa
- Watching photo albums.
- Ultramon
- For window and multi screen management. I use it solely for the shortcut commands.
- Daemon Tools Lite
- File mounting.
- FileZilla
- Ftp client.
- Damn NFO Viewer
- View NFO files.
- Notepad++
- Smooth text editor.
- uTorrent
- Download torrents.
- VLC Media Player
- Media player of choice.
Tools for collaboration
- Skype
- Great client for obvious reasons. Calls made simple.
- Windows Live Messenger
- The IM client.
- Google Talk
- Keep track of your mail and Gmail contacts.
- TweetDeck
- Twitter desktop style.
The browsers
- Google Chrome
- The one and only. Fast and reliable.
- Firefox
- The best browser for web developers.
Tools from the largest of them all
No comments needed.
Do you have any favourite Windows tools?
Over and over again, I stumble upon web projects where someone other than the developer has estimated the development time. Nothing could be more wrong.
A developer, no one else, should estimate the time for a set of tasks involving development.
Even more important, the developer(s) involved in the project, should do the time estimation.
Why is this? Well, for starters, this will give you a more accurate timesheet. And this will certainly help your customer relationship.e
Here's some more reasons to why developers and no one else should do the time estimates:
- Developers probably has the best knowledge of how much time a specific task will consume
- A more accurate time estimation will actually give you an idea on how much time is needed for a specific project, making planning a bit easier
- Issues might be found earlier
It's a no-brainer, the craftsman whose expertise area is development, should do the time estimation.
So when the next project is due - take your time and make sure a developer does the time estimation before a time limit and definite price is set with the customer. It'll help you a lot.