Archive for category css

HTML5 Site – WFB Site UI Design / HTML Structure (Part 2 of n)

(Back to beginning of series)

Part 2: Site UI Design / HTML Structure

When I first picked up the project, I had a few things to consider: what requirements do I have, and once I had those, how would I display these feature in a neat manner, and what technologies would I use to implement them. The requirements part came out pretty easily, after a couple of phone conversations:

  • Calendar of events
  • Photo Gallery
  • News section
  • A few generic pages
  • Email mailing list
  • Misc. vital information (times open, address, that sort of thing)

And now I needed to put together some kind of design. I had recently finished reading a few usability books, so I was feeling pretty good about putting some of these ideas to work. I knew that people coming to the website were probably going for directions, a phone number, or hours of operation, so I put high priority on these being visible and easy to use (such as a Google Maps link for the address). I also wanted to entice people to explore other areas, so I added some photos from the photo gallery towards the top of the page. Finally, I included elements from all the page- just little teasers- across the front page, such as a small calendar of events, news block, and a blurb and picture about their restaurant. Now, I had a home page with all the information a user needs, quickly and at the top, while encouraging visitors to browse a little and check out the gallery and other pages for even more information.

With this sketched out on paper, it was time to actually write out the HTML. I came up with a structure similar to my HTML5 Template (and in fact, it’s what I based my template off of.) I wanted to use the new semantic HTML5 elements and attributes, such as example text on textboxes:

<input type="text" name="Email" id="email" maxlength="60" placeholder="email@youraddress.com" />

I used the help of a jQuery Watermark plugin to help style the textboxes as well, since few browsers actually pay attention to the placeholder attribute yet. Further HTML5 inclusions were sections for the individual blocks of text, an aside for the side column, header, footer, and nav elements. Besides the HTML5, I also implemented a link tag for the news RSS feed:

<link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.waterfordfamilybowl.com/wordpress/index.php/feed/" />

This allows browsers and whatever happens to crawl your site to say “hey, there’s an RSS feed here” and allow users to easily pick up the news RSS feed. You’ll notice it in FireFox, IE, and Chrome if you have an extension installed.

Reblog this post [with Zemanta]

Tags: , , , , , , ,

HTML5 Site – Waterford Family Bowl (Part 1 of n)

Waterford Family Bowl website

Waterford Family Bowl website (www.waterfordfamilybowl.com)

A little while ago, my aunt approached me- she needed a website for her bowling alley. “Sure,” I said. “Let’s go over what you want and we’ll build something that works for you.”  In the back of my mind, I was thinking “awesome! Perfect timing to flex my HTML5 muscles and try jQuery 1.4 in a production environment; will it work?”

The site’s now completed, and in production. Go ahead and check it out at http://www.waterfordfamilybowl.com (still waiting on a little alternate content :) ). I’m going to, over a series of 4 or 5 posts, go over how the site works- how and why I used PHP, jQuery, HTML 5, jQuery, WordPress, Picasa, Google Analytics and Webmaster tools, and Google Apps; and, how I merged them all to create a dynamic, easy to use and easy to edit website. I used principles from books like “The Design of Everyday Things” and “Don’t Make Me Think”, and I’ll explain how and where these came into play.   The process I took made even IE 6 compatibility a breeze!

Brief overview on how I plan to break it down:

1. Intro to series
2. Design - architecturally and graphically
3. Implementation of WordPress, Picasa, etc.
4. “Contact Us”, finishing touches
5. Google Analytics and Google Webmaster Tools overviews
6. Wrap-up (maybe?)

Reblog this post [with Zemanta]

Tags: , , , , , , , , , , , ,

Neflaria V2: HTML 5, jQuery 1.4.1

Yay! I love jQuery! I love HTML html 5! I love CSS 3!

And, I’ve decided that Neflaria, Version 2, will be my playground.

Neflaria, for the unacquainted, is the online game that my friend and I inherited a couple years ago. You make a character, you log in, and you fight monsters and chat with other players; while there’s not a whole lot to the game, it has been around for about 10 years, and as such, has a lot of character. And a lot of characters. I mean that endearingly. (Hi, Chris)

However, to a lot of the players, and definitely to me, its 2001-era look is a little stale. Its 12px Times New Roman on 100×100 pixel repeating background. Another word might be “dated.” The server-side database and file structure is a little crazy and unorganized, and it is time for an upgrade. So, here’s where Neflaria version 2 comes in.

One of the decisions we made was to move forward and to use jQuery 1.4.1, which niftily came out just as we were restarting development, to use html 5 (by including the wonderful html 5 shiv [blog post, javascript] for backwards compatibility), and do as much as we can to bring Neflaria into 2010 while at the same time making sure that the people playing the game- who are probably still on IE6- aren’t left out in the dark. Now, I’ve always railed against IE6, and I hate IE6 support more than anything… but by building on a solid base of well-structured html, css, and javascript, we can bend the styles later on to suit IE6′s needs, while maintaining future compatibility. “Graceful Degredation” is the term of the day.

We’re developing Neflaria V2 looking for the future. We’re building our javascript more like a framework and less like a loose collection of methods called “x2″ and “j5″. We’re restructuring the database (aka normalizing the heck out of it) and using JSON served piping hot via short but precise PHP pagelets. It’ll be very client-heavy, assuring server-side performance, and it’ll be extensible for future features. We’re even working on multilingual support, using jQuery to query a language-based XML file by key.

I’m pretty excited. Get a preview here (only the home, terms of service, privacy policy, and “create” and “login” buttons do anything, and it isn’t wired up to the database): http://labs.crimsondeviations.com/NeflariaV2Preview/

Tags: , , , ,

Re: “Why CSS should not be used for layout”

First, read this. Then come back.

I’ll wait here.

Ok, good. Now, here’s why the article’s complete and total garbage.

On his first point:

The CSS layout primites are inadequate because they do not allow elements to be positioned relative to each other, only relative to their containers.

They don’t? What about floats… do they not effect direct siblings? Can you not change positioning? Maybe I’m missing something here, but we’ve got the ability to change element positioning relative to other elements as well as the container (or even display on the screen at all times (“floating” elements on the screen), or display anywhere on the page). Using the table method that Ron advocates only allows you to position relative to it’s sibling. A table cell, which spans 1-n rows. A table cell that requires you to restructure your HTML (or at least move your content) if you want to move a section from the left, to the right. Whereas I could just swap the float, changing a couple lines of CSS.

The way CSS layout is rendered results in unavoidable interactions between the style sheets and the underlying content. So even when CSS is used exactly as intended, it is not possible to separate content from layout.

Unavoidable interactions? Giving elements IDs (which is good practice anyway), classes, and a <link> tag? Is this worse than creating an immutable structure? Again, perhaps I’m missing something somewhere, but the liquidity of a <div> layout is far superior. It’s changable, it’s easier to get things where you want them to go, it’s less HTML markup gunking up your content. A nicely “divved” layout is cleaner, easier to modify. Yes, I have to add IDs and classes… but a semantic, descriptive markup is far easier to read anyway.

One of the problems with criticising CSS is that it’s very hard to write good CSS, so pointing out problems with CSS begs the question of whether this is an indictment of CSS or one’s coding ability.

Hard for who? And regardless of difficulty, it’s a bit strange to denounce an entire language (markup syntax?) because it’s “hard”. C# and Ruby and Python and baking and riding bicycles can be hard for beginners too.

Ron follows his CSS bashing up with a kluge of examples that do nothing except show he has no idea what he’s doing, and badly mangles examples, saying “look, I reversed it, and it ‘sploded! css sux”.

But the point is they have to be fixed! The correct CSS is inextricably bound to the content. Smarter people than me have tied themselves into knots trying to figure out how to make a three-column CSS layout that doesn’t have these problems. To my knowledge, no one has succeeded. It may be possible.

To his knowledge, nobody’s suceeded? Funny, because several of my own websites use 3-column CSS layouts, without “these problems”. Because I understand how CSS works. Because I’m not afraid to get my hands a little dirty, and because I don’t base my knowledge on display-view of Dreamwaver.

All it comes down to is the ranting of a man who has no idea what he’s talking about. CSS is perfect for layouts. It’s hard, as he readily admits, but once you understand it’s semantics, understand when and how and what to apply, there’s nothing better.

Tags: , ,