-
custom div attributes
I just wanted to get the pros take on custom div attributes.
I'm trying consolidate edits for a client and simply using the .html as the flash movie's xml is working well... but, I'm pulling this off by adding custom attributes like this
<div id="menu" data="nav.swf">...menu...</div>
Which of course doesn't pass w3c validation. Should I lose sleep over this or not?
-
It's technically not going to cause a problem, but why not just use a tag that's already available for use instead of creating your own?
-
The <div> tag only supports id, class, title, dir, lang, style and xml:lang.
Which one would be safest to repurpose?
I need id, class and style for styling of the alt content, title would make for some odd looking tool tips. I wouldn't want dir to cause some weirdness late in the game. Same with lang.
Custom names allow for much more control when it comes to using E4X in flash.
I usually have the attitude that the w3c is by no means perfect and I shouldn't sweat using a little creative license but I just love it when my pages pass with flying colors.
-
Yeah, you are right, but that also means that there's typically a better way to do what you're trying to do. I've never come across a situation where I needed a custom attribute, because if you're using that, it means you're using Javascript of some sort to manipulate something. So you can just use normal Javascript variables or something.
It's hard to give specific advice without seeing the specific situation.
-
Its a typical swfobject situation where the flashContent div contains the xhtml version of the page. The flash movie turns around and loads the very same .html doc instead of it's own flat .xml. The idea was to consolidate the data so all they ever have to do it edit the .html instead of an .html and an .xml.
It all works fine but now I'm dealing with the issue of customizing the flash layout.
Normally in .xml I'd do this:
<module x="100" y="200" width="50">
hello world
</module>
Where the flash movie was able to create and position a number of displayObjects.
If I have to I'll go back to using two data sources which I just know the client will screw up eventually.
I'm contemplating condensing the data in a delimited string like
<div id="mainArticle" class="square" data="x:50|y:100|width:50">
yadda yadda
</div>
where flash would split the data value and use as needed.
There's no way I'm going through writing a custom DTD.
-
Ohhh, I see. That is weird, but you already know that. :P If it suits the situation, go for it. The W3C isn't going to come kill you. And writing a custom DTD isn't as hard as it sounds, but it really wouldn't help you validate. Since validation takes into account that it's valid HTML 4.0 or whatever for the web. I can have a valid RSS feed, but it doesn't validate as a website to the W3C.
-
In a perfect world I'd be able to build a backend for the whole damn thing as well as do it in php. No budget, no dice. So I'm left with trying to make the most idiot proof content manager and a single point of reference, albeit unorthodox is completely feasable and so far my parsing of a @data attribute is working fine. **** the w3c. That's right I said it.
-
Then go for it. Tight budgets don't allow all the time for everything done properly in exchange for convenience.