Web dev quick tip: Style your INPUT elements by type

One thing I recently found out from looking through some example CSS: when doing web development or design, you may want to apply certain attributes to one type of input field but not another. For example,

is coded:

<input type="button" value="A Button" />

The problem therein is that you may want different borders, backgrounds or sizing attributes for your buttons, text fields, radio buttons, check boxes and password fields. Internet Explorer is an especially aggravating candidate for this, since it enforces border styles around the actual radio button itself. Safari behaves differently than other browsers as well, since it likes to enforce OS X-style control attributes.

In your CSS file or <style> tag section, you can force specific elements with attributes to take certain styles, such as this example from a recent project:

input[type="text"], input[type="password"], textarea {
border: 1px solid #aaa;
background-color: #f5f5f5;
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
border: 1px solid #336bc3;
background-color: #ffffff;
}
input[disabled][type="text"] {
border: 1px solid #888;
background-color: #ddd;
}
input[disabled][type="text"]:hover {
border: 1px solid #888;
background-color: #ddd;
}

In this example, text fields and textarea elements will be styled with a specific background color and border, which won’t affect other elements such as buttons.

Another neat trick I’ve learned while working on this project is the ability to put action images inside <button> elements. Instead of the <input type="button" /> tag, using the HTML 4 <button> element allows even more tricks. For example:

<button type="button"><img src="images/rss.gif" alt="" /> RSS</button>

would give something like this:

These are a few of my favourite apps

I’ve had several articles and references to my computer setup and preferred applications written before. I figure the list is due for an update with the latest hotness in technology.

CD/DVD Burning

DVD Video Burning

  • RipIt4Me with DVD Decrypter and DVD Shrink

Virtual DVD Drive

Instant Messaging

BitTorrent

Newsgroups

Graphics Editing

  • Fireworks

Audio/Video Players

File Transfer Clients

Programming and Development

Texas Hold ‘Em for 360 updated with webcam support

As per Major Nelson’s post:

The free update will introduce several significant features, bug fixes and updates based on user feedback, including Xbox LIVE Vision Camera support (player bankrolls will not be reset with this update).

Now with live video, players can put on their best poker face and scrutinize the faces of their opponent’s in true poker fashion. Using the Xbox LIVE Vision Camera also allows players to use a series of game faces using the snapshot mode for all-ins, wins, losses, folds and more. Other features of the update include the following:

· Improved usability such as the addition of Custom Match Lists, which allows gamers to view and select which available Custom Match game they would like to join.

· Improved rich presence in the game, allowing players to not only see what their friends are up to, but also if they just won that big pot!

· Improved matchmaking and user results.

· Scoring and screens are more readable than before.

· Multi-language support including English, French, German, Italian and Spanish.

New premium downloadable content allows players to customize the in-game environment, and access new gamerpics and themes

This update being free almost makes up for the travesty of the Guitar Hero II song pack costing $6.25US for three songs. Didn’t they hear the massive outrage last time? It was even worse than the horse armor scandal with Oblivion.

AAAAAAAAGHHH SONY: E3 reading

I’ve been reading the E3 transcripts since last night to try and figure out what people are doing. Phil has some interesting points about the OMGCOOL games coming out, but this quote from a Singstar developer made me want to throttle someone:

12:10PM PDT – Singstar dev. “When you think about it, it’s like iTunes meets MySpace.”

I have no doubt in my mind that this combination would not only run your computer out of RAM in less than a second, but it’d be full of security holes. Instead of the music store, you’d get twenty popups from Russian brides and Nigerian scammers before having Justin Timberlake and Fergie tracks forcibly entered into your library.

Oh, and the default font would be Comic Sans MS.

Update: This HAD to be Photoshopped. Ads are from Something Awful in case anyone gets uppity about copyrights; I’ll remove them if anyone complains.

iTunes + MySpace LOL OMG

Held in contempt: Woman listens to MP3 player while serving on jury

I find that one of the more interesting parts of the law is any action related to “contempt of court“. The term basically covers any tomfoolery that goes on during the serious legal business of a trial, and most judges are given free will to impose punishments. Generally you don’t see people sent to county jail for more than 30 days for the offense, and that would be a serious situation indeed.

In any event, this woman was caught trying to get out of jury duty, giving lame excuses, and eventually it was discovered that she was wearing an MP3 player under her hijab. Unfortunately this sort of thing could spawn a knee-jerk reaction; especially if it occurred in the States.

I assume it could easily occur again with anyone with long hair, or a cleverly-disguised Bluetooth earbud. One might expect that jurors would have to pass through a metal detector before entering the court, although that might not find certain solid-state devices. Personally, while jury duty might suck for people, I believe that avoiding it is the sign of a self-indulgent jerk. Hell, you could always be serving in the army for your country instead.

What type of measures would you think of that could alleviate this situation? Is it more of a social conditioning angle that needs to be reviewed, or is there any technical prevention process for this sort of thing?

New IllScarlett album, $10 from Future Shop

IllScarlett’s new album was out as of yesterday, and Future Shop has it for $9.99. With shipping and tax, it comes to $13.09 – I’m lazy and want it dropped off at my house, and $1.50 for shipping is worth it. They’re the first artist whose album I’ve bought in a while. Here are my last three CD purchases:

  • IllScarlett – EPdemic (purchased this year, going for $5 on futureshop.ca now: definitely worth it)
  • Halo 2 Original Soundtrack Volume 2 (released Jan 1, 2006)
  • Halo 2 Original Soundtrack Volume 1 (Halo 2 launch, November 2004)

Seriously, pick it up. These guys put on an excellent show when I went to go see their concert at the Wax in Kitchener. On an even more nerdy note, it’s an excellent album to crank and test speakers with.

Weird Al in Toronto (alternate title: Too much construction)

A few friends and I went up to Massey Hall in Toronto last night to attend Weird Al’s concert. As per our usual adventures when going anywhere outside of the K-W area, we managed to get ourselves embedded in a massive number of confusing roads, and found ourselves several times in places of town better known as “Sketchville”.

The show was quite excellent – there were songs from several of his previous albums, and in between the full-length segments there were some fairly hilarious Al TV interviews. The interviews contain clips spliced in from actual interviews, along with Al’s ridiculous reactions. There was an absolutely brilliant segment where he ‘interviews’ Kevin Federline and completely trashes the guy – “Why are you such a colossal failure? How does it feel to have an entire closet full of wifebeaters – and no wife? Are you the world’s biggest douchebag?”

Polkarama! was the first song played, followed by “Canadian Idiot” and several more full-length songs. During about the middle of the show, Al played a mix of about ten songs consecutively, singing about a verse and the chorus and switching to the next one. There was an excellent parody of “You’re Beautiful” called “You’re Pitiful”, as well as nearly everything from the new album (“Confessions Part III” and “Do I Creep You Out” were on the list.)

Overall, it was a very decent show. His stage presence was what you’d expect, and I was equally impressed with the backup band’s performance. Al also played Albuquerque for the encore, which was pretty hilarious – it’s like the epic anthem song that’s a classic “why is this song so long” event.

Welcome, Phil: another one joins the mess

My good friend Phil has joined the ranks of the whiny bloggers union and installed WordPress. He will likely complain about things even more vocally than I, perhaps in a more emo-tastic way. Go visit him and convince him to keep things online, since he gives things up quickly if not encouraged. 🙂

Wireless data in Canada: my opinion and followup

In recent months, I’ve often complained about the state of wireless data access in Canada – that is, how expensive it is to use the Web, access email and operate instant messaging over mobile devices. These incredibly high data rates make access to devices like the BlackBerry, HTC TyTN, and the obligatory iPhone limited to those users who have a business or government-locked plan with unlimited access.

One of the references I frequently cite is that Canada is worse than some third-world countries when it comes to this sort of thing.

As an aspiring developer, I’m incredibly interested in what these new devices are capable of. In order to make a serious go of Web development for mobile devices, though, it’s at least a $200 plus contract investment.

Working for Research in Motion gives an especially interesting perspective on the scenario. As a co-op student, I have a device with an (allegedly) unlimited data plan; co-ops don’t get voice (phone calls) activated on their units unless it actively relates to their job role. Since I work on BIS projects, this doesn’t apply to me – which is fine, I’d rather not place personal calls on a work device. I’m not an incredibly heavy data user by any means: I hit Google News once per workday at lunch, and I used Blackberry Maps for about 20 minutes this weekend to try and find out where MacGregor Point’s entrance was.

If I added in a bit of Facebook Mobile access, this type of data usage as a standard consumer would likely put me in a 25MB/month bracket – less than 1MB per day, which could easily be eaten up with a few Google Image searches.

Such a level of usage would require a $60/month, three year contract purchase plus whatever cell phone voice package I selected. Unless I was willing to call up my provider and argue over retention plans (which is a very popular topic at Howard Forums), I could be paying well over $100/month.

The ever-present speculation on forums and blogs to date seems to surmise that if and when Rogers is awarded the iPhone contract in Canada, they’ll be forced by Apple to reduce data rates to something more in line with the United States unlimited plans – $60 per month for a goodly number of minutes, text messages and unlimited EDGE access. Once this change is implemented, the other carriers will supposedly fall into position. I don’t have any insider industry information on this though: one would think purchasers of the BlackBerry Pearl, the highly consumer-oriented device, would already be raising hell about the situation.

As a consumer, I’d welcome lower-cost, wide availability of data plans. Just don’t count on the magical Apple product to change things here. I’ve heard suggestions of writing to the CRTC, the MP for my region, the Minister of Industry, and the Prime Minister. Would any of these things actually be the correct place to direct my concerns?

Standard disclaimer: Although I work for RIM, chances are you know just about as much as I do about future product plans, business speculation, and carrier relationships. Go check Engadget or something if you really want dirt. Anything mentioned in this post or on this site is strictly my opinion and most certainly not that of my employer. This posting confers no warranties, rights, or anything else that you think you’re owed. I’m under an NDA, so anything mentioned here is already public knowledge or my own personal speculation.