So we use CSS to style elements and keep semantic separate from aesthetics. and CSS is great and getting better at allowing almost any layout option regardless of the mark up so it's hard for me to find excuses to use mark up for .. well .. layout.
The question is this say you sad quiz in the form (pun) of a form ( or anything like this the example is fictional). so each question is a fieldset with the question text. That simple enough and each answer option is a... hmmm? Well a radio button and a label seem like a good idea; it cuts down codeand is totally semantic. One could even place the input inside the label tag.
Code:<fieldset> <legend>So this could be the question here. It could be long or short or it could just be a header for multiple questions coded as follows.<legend> <label><input type='radio' name='answer'>an answer option and its corresponding button. I dont even need an ID if its wrppped this way and it seems perfectly semantic and streamlined</label> <label><input type='radio' name='answer'>another answer</label> <label><input type='radio' name='answer'>another answer</label> <label><input type='radio' name='answer'>another answer</label> <label><input type='radio' name='answer'>another answer</label> </fieldset>
Again with a little CSS one can layout this in to to a nice looking easily readable AND ACCESSIBLE FORM. But what if CSS is OFF? Then you have a long line of text punctuated by radio buttons. That is perfectly accessible, but a pain to read and use. We can solve this by placing BRs between each label or wrapping each label in a block level tag. But in each case we are adding extra mark up and purely for presentational reasons. Damned if I do damned if I don't.
So I was wondering what the forum expert consider the right approach to this kind of conundrum?





Reply With Quote
.
.


Bookmarks