Stylehack

The Fall ‘08 session at LVS Online ~ Where Learning Is Fun!

12+ NEW Classes, over 100 Classes in All!

With 12 new classes being offered this session, LVS has over 100 classes on its roster. From Instructor-led to Self-study, LVS covers a wide range of subjects. And don’t forget the FREE Windows XP and Vista classes!

To check out the courses you would like to take, a complete list is given at LVS Course Schedule.

Intructor-led Classes in a Virtual Setting

If you’ve never participated in a virtual classroom setting, you’ll find LVS the perfect choice for initiation into the online learning environment. Administrators and instructors alike understand what it’s like to be a first-time enrollee and work with you to overcome any concerns you may have.

Each instructor-led course has its own virtual classroom accessible to enrolled students with a forum-type message board used to post assignments, ask questions, and interact with the instructor as well as the other students who signed up for that class. Instructors maintain a friendly, fun, and energetic setting in which to learn.

Instructor-led classes begin August 30th so head on over to LVS Online Classes to enroll now.

Build a Website

LVS offers a 3-part website coding series that takes you from “I don’t know anything about X/HTML & CSS” to “WOW - I can create a valid website” in no time at all and you’ll have a great time doing it, too.

If web site coding is something you’ve always wanted to learn, now is the time. Get started by registering for the introductory-level course Build Your Web Site I today!

Don’t need an intro class but you’d like to strengthen and/or build on the skills you have?  Head on over and check out the Level II and Level III courses. I happen to know the Level II instructor will be happy to check out samples of your work; if you meet the criteria she’ll accept you as a student without your having to take the intro class! How do I know this? I’m the instructor. “-)

Validating XHTML with Javascript

Ever inserted a snippet of JS you snagged somewhere online? Or have a script you’ve been using for years but now you find it prevents your code from being valid per W3C standards?

It’s actually really easy to fix the problem; it’s probably harder to determine what the problem is first!

I wrote an article on just this topic for a class blog related to the XHTML/CSS class I teach at LVS Online:

http://lvsonline.com/online-xhtml-css-classes/?p=13

Get on over there and get the scoop on how to validate your pages when you are including JS! “-)

How to Use the W3C Validator Results, the Short Answer.

Oh NO!  You worked hard, shed blood/sweat/tears over your web page. But when you tried to validate it, the W3C validator said you have errors! What should you do? The easiest answer is shut your computer off and spend some time with “live people”. But since you’re reading this, I guess that’s not what you want to hear. “-) Ok, my first question back to you is: have you taken any training in web coding standards? If not, your first step is to take the Build a Web Site series of classes at LVS Online. The more you learn, the less mistakes you’ll make in your coding. The instructors in those classes are very knowledgable and not anywhere near as crabby and mean as I am. “-) Even the best of us will still have errors from time to time, so let’s talk about how to use the results of the validation process to fix the problems. It’s really quite simple:
1. READ the comment and THINK about what it is saying, then ACT on it. For instance, if you see “xyz is not a valid attribute of ABC” try removing the invalid declaration(s). Check your page — does it still look the same? (Yes it will.) Re-validate. If the page validates and it still looks/performs as desired, you’re done. (If this doesn’t work, see #2 below.) Sometimes the results will even use wording similar to “xyz is not valid here. This usually is because blah blah blah.” Gasp! It even gives you some ideas of why something might be invalid!
2. RESEARCH the offending issue on the W3C site. Look up ABC and read what the valid attributes are and use them instead of xyz. At the top of each results page with problems, you will see something like this:      This page is not Valid XHTML 1.0 Transitional! Guess what? The XHTML (or HTML if you are using that standard) is CLICKABLE and takes you to the specs themselves so you can easily research your problems.
See? That’s not so hard is it! The more you do this, the more comfortable you will be with using this tool to create clean, well-structured documents on the web. There’s one other site you may find helpful — W3C Schools (not affiliated with the W3C itself). There are some good reference areas there for both coding and CSS. Be advised, however, that not everything there is cast in stone… I have run across the odd item that elicits a “Hmmm, that’s not exactly correct/complete”. Links to Resources mentioned in this article Online Classes    Build Your Web Site classes at LVSOnline    http://register.lvsonline.com/advanced_search_result.php?keywords=build
W3C Validator Links
   Explanation of Error Messages    http://validator.w3.org/docs/errors.html    Very Frequently Asked Questions about Errors (List starts here)    http://validator.w3.org/docs/help.html#faq-doctype    HTML 4.01 Specs    http://www.w3.org/TR/1999/REC-html401-19991224/    XHTML 1.0 Specs    http://www.w3.org/TR/2002/REC-xhtml1-20020801/    X/HTML Validator Page (type in your links or upload your local page)    http://validator.w3.org/    CSS Validator Page (type in your link, upload a file or validate a block of text)    http://jigsaw.w3.org/css-validator/    CSS Validation FAQs    http://www.websitedev.de/css/validator-faq
Other Resources
   W3C Schools HTML 4.01 Reference    http://www.w3schools.com/html/html_reference.asp    W3C Schools XHTML 1.0 Reference    http://www.w3schools.com/xhtml/xhtml_reference.asp    W3C Schools CSS2 Reference    http://www.w3schools.com/css/css_reference.asp

Forcing IckEee (Internet Explorer) to Display Your Favicon

I rarely take the time to create a Favicon, but when I do — like for this particular blog — it would be nice if it was actually used by the browser. Without getting into a rant, if you use a REAL browser like Opera… or that “other” browser (aka Firefox)… then it’s not an issue. It’s only an issue if you use IckEee as your main browser. (See? No rant. grin. But no link to FF either. teehee) To make a Favicon show up in IE’s address bar, here’s the trick: Drag the blue E favicon off of the address bar with your mouse and drop it anywhere on the web page; when you let go IE will reload and replace the icon in the address bar with the Favicon for the site. I tried it, it works! Thanks to my friend and teaching partner at LVS Online, Kat (Kathy Clark) for the tip.

XHTML Validation & Flash Movies

One of the hurdles Web Coding Standaristas place in a Flash Animator’s path is that of validation — the way that Flash movies have historically been inserted into web pages does not conform to current W3C standards. Boo hoo. “-) A couple of years ago I stumbled across the article on ALA re the Satay Method of inserting a Flash movie so that the page will still validate. It was a great article, contained a plethora of information on who/what/when/where/why and how the author had arrived at the method as it was explained at that time, and where the author felt it still needed work. To my mind the operative word was “work”… there was too much of it involved. If the visitor can find my site/page, he/she can accept some responsibility for taking the extra steps necessary to view all the content if it’s really that important to them. So I decided then and there to get rid of all the extra “stuff” in the Satay post and use only the bare basics that I felt were necessary to meet some specific considerations:
1. Valid coding practice 2. Meet basic Accessibility Standards 3. Provide a solution to the visitor without the Flash plugin or who has (gasp) blocked the play of Flash animation
Mostly, though, I decided to do this to impress and awe my pal Farron. She’s a web standards worshipper.. er I mean Web Standards Coding Instructor [whipping head around in fear to make sure she's not reading this!]. “Impress and awe” is defined in Stylehack-speak as “Prove it can be done”. “-) Selecting the level of Standards To cover future bases as much as possible, I decided to aim for validating to XHTML 1.0 Strict. The same practices will work at other levels… XHTML 1.0 Trans and I think HTML 4.01 also, though it’s been so long since I coded that way I could be wrong. Here is the DOCTYPE declaration for an XHTML 1.0 Strict document:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
You’ll notice I left off the XML declaration… I’ve had trouble with it tossing one browser or another into Quirks mode, so I include it only sparingly.
<?xml version="1.0" encoding="iso-8859-1"?>
Defining the OBJECT Tag There are many great discussions and how-tos on the web that discuss the merits of just about every topic, including the use of the OBJECT tag that is used to insert a Flash animation. So I’m not going to go into that here, I’m simply going to give you an example of how I insert a movie and explain my logic (or lack thereof).
1 <object type="application/x-shockwave-flash" data="myMovie.swf" width="431" height="68">
2 <param name="movie" value="myMovie.swf" />
3 <param name="BGCOLOR" value="#000000" />
4 <a title="You must install the Flash Plugin for your Browser in order to view this movie"  href="http://www.macromedia.com/shockwave/download/alternates/"><img src="needplugin.gif" width="431" height="68"  alt="placeholder for flash movie" /></a>
5 </object>
Note: The above code example should not have a hard return in it breaking what was one line into many lines (line 4); this example was allowed to wrap for purposes of presentation, so there you go. Obviously, it will not have actual line numbers when you recreate it. “-)
Line 1:  The only variables on this line are the name of your movie and its dimensions. Do NOT remove the ” (apostrophes) around the name of the movie nor its dimensions; Line 2:  This param (Name) is required for cross-browser compatibility. (Don’t get me started on my IE-is-bad and FF-is-the-IE-of-Geek-Wannabes rant! Good thing I shut off comments here. grin) Anyway, the name you put here must match the name in Line 1. Again, don’t remove the ” (apostrophes);
Note: Lines 1 and 2 replace the old OBJECT/EMBED combo used to address how various browsers have accessed Flash movies in the past.
Line 3:  An optional line; there could actually be more params used than are used in this example, any that are considered valid for the OBJECT tag can be defined as necessary and applicable; Line 4:  This is the line that addresses missing plugins, browsers where animation is shut off and older browsers that can’t do the Flash movie thing. On top of which, it adds a level of accessibility to your movie for visitors using a Text Reader. It’s a work of art. “-) Basically, you need 3 things here….
a) An image to replace your movie. It can be a screen shot of your movie, or an image that informs the viewer they need a plugin to view the movie. To prevent any problems with your page design, you should make this image the same size as the movie; b) A destination URL where your visitors can get the Flash plugin, if necessary. In the example above, I have used the link to the page on the Macromedia site that offers download links for plugins to fit a variety of operating systems and/or browsers. These links change from time to time, so you need to remember to check them every now and then. Another option would be to make this link to a page on your site that then offers a link to Macromedia; if you have a lot of movies on your site, it would be easier to update the link on that page rather than a bunch of static page links. Of course, if you use a dynamic method of site generation, like PHP, this could be a variable so you only have to change a single declaration to impact your site. I’m getting offtopic, right? “-) c) Appropriate ALT and TITLE tags for your page, both for accessibility and clarity.
The implementation of these 3 items is EaSy PeAsY, as debbieT says! Simply wrap the image in an A tag (hyperlink). See? That wasn’t hard at all. Why do it?   When a visitor doesn’t have the Flash player (or has shut off Flash animation) their browser will display the image declared in this line. When they roll their mouse cursor over the image, the TITLE will pop up so they can read your instructions/comments. If they have images shut off, they will also see the ALT tag. Clicking on the image/link will send them to the Macromedia site so they can get the appropriate plugin. Whether you use an image with words (”You need the Flash Player to see my movie!”) or a screen capture of your movie, you need to be sure to use clearly thought out TITLE and ALT text. This is good practice for you for accessibility purposes… they should not be the same, but should work together in some way to describe an object or — in this case — also pass on information. Line 5:  Don’t forget to close the OBJECT tag. Summary Believe it or not, this is all you need! The movie plays or the image is displayed. And best of all, it validates as XHTML 1.0 Strict! Of course, you will have to insert this bit of code into a valid structure… it can be put in a DIV or a P, for instance. Please keep in mind that if you are using Flash MX 2004 and that blasted sniffer publishing method, you will need to fiddle this information a bit. I personally don’t like sniffers, so that’s not an issue for me. What’s that?  You want to know if there is an easy way to gather the info about your movie and the params you normally used? Sure! Simply do the Flash export/publish to HTML thing, then use that as a source of info to create your own OBJECT tag in your page. Slacker’s Rule #472. “-) And that concludes today’s Blah blah, car ride. (What another of daHens — Butzi — calls my “discussions”. hehe) Footnote 1: There are several geniuses who have come up with this stripped down method in the last year and wrote it up on their blogs; this article is not based on their publishing. I was using it long before they “published” and simply put off writing it up for our Flash and Swish classes - not to mention the Build a Website classes - because I am ~The~ Slacker! Just for the record. Footnote 2: This method is not recommended for a gigantic movie without a proper preloader sequence and planning, nor is it the best way to handle streaming Flash animations. For that, there is another trick that is part of the complete Satay Method using a 1×1 empty movie as a sniffer. Footnote 3: Farron’s blog is called Catartis. I only referenced her “other” site above because I wanted to harrass her a bit. hehe. For the record, the other daHens (Butzi, debbieT and Liann - in alphabetical order) are available by link up on the right.

Stylehack © 2008 - Becky Peters :: All Rights Reserved
Powered by WordPress