views:

125

answers:

5

If yes then presentational elements would be helpful in this condition so should we use those?

<b>…</b> , <i>…</i>, <big>…</big>, <small>…</small>, <tt>…</tt>, <hr />

These are valid tags

+8  A: 

The page should be marked up semantically, not for its presentation. If you put proper semantic markup on elements, the browser will usually apply a basic style to them by itself. You should not be concerned with how the document looks unstyled. If it's unstyled, it has no style. CSS is responsible for the style. If a user chooses to view the document without style, let it be so.

deceze
This is true, with the qualification that the unstyled page will generally give you a strong sense of how well you have marked-up the page. The entire reason for semantic markup is to make the content available (and legible!) apart from the style. The unstyled page should read like a reasonable text document. That is an argument *for* semantics, not for presentational markup.
Eric Meyer
@Eric Exactly what I was trying to say with "browser will apply style by itself", but better put. :)
deceze
A: 

Technically, you could pretty much create an entire page using <div> and <span> tags. That would just be messy though, and not very intuitive. Personally, I find that the tags you list make it easier for a human to parse what the page is attempting to communicate, while also offering the benefit of making a page readable when the CSS doesn't load.

Matt Huggins
`<b>` and `<small>` do very little to communicate an HTML document's structure. I'm all for `<ul>` and `<li>` where it makes sense, since they *do* represent structure, but... no. The tags he describes are deprecated for a reason.
Matchu
A: 

Yes and no. No because there is no guarantee how this tags will be interpreted. Yes because we must assure that page will not break apart if browser does not support CSS.

And that down vote what for? The question was "should we always consider" - it depends on what you are actually considering - layout or precise look & feel.

doc
No web page will ever "break apart" if a word is not bold. The only tags the OP describes here are presentational tags, which will not break anything if absent.
Matchu
Of course whole layout can break - CSS menus, floating blocks, etc may overlap each other. Just check what old Netscape Navigator 4 can do with div-based web pages.
doc
@doc Yes, but you should not replicate the layout you're making with CSS in pure HTML. Then you're pretty soon back to tables, and that's exactly what you don't want. Any decently semantic website displays okay (as in *"readable"*) without CSS, but most likely not anywhere near the way it would look with CSS. Either style it or don't style it, certainly do not style it twice.
deceze
doc
@doc I wasn't so much replying to your answer as to your above comment about breaking layouts. (For the record, I also did not vote your answer down.) If a layout breaks in browsers with insufficient CSS support, there's little you can do to fix that using markup. The site will just be broken in that browser with CSS on. Without CSS, the site will look completely different anyway. So, since you can't replicate the CSS style in markup without resorting to tables, just let the browser display your purely semantically marked up document, it'll be good enough and usually not broken, just unstyled.
deceze
The phrasing of the question, in that it starts with "should," implies that it is a question about best practice rather than any sort of technological limitation. Therefore, to say that the OP *should* build semantically is fine - and, in fact, the best possible thing to say.
Matchu
A: 

It sounds like you're asking if you should use tags like <small> so that, in the absence of CSS, what you want to be small will be small.

No.

The reason to consider how the page will look without CSS is to know if you are using good semantic layout. If it's usable, your HTML, which is only designed with semantic organization in mind, is okay. That's it. If your users, for whatever reason, don't want to support presentational things like CSS, don't use presentational tags.

And, really. If your users don't have CSS for whatever reason, they don't deserve to see something as bold. It's more work for you, it's not semantic, and no one will ever care.

Matchu
+1  A: 

Generally a ("normal") user cannot disable CSS as easy as JavaScript. So I would answer NO.

CSS is a part of the presentation and when the CSS is not available we should think that the presentation is not available. Thus the client side is broken.

You should not be concerned about that as you don't want to debug a client abusing the presentation.

BUT, if you need to support non-standard devices (old mobiles maybe) this is a valid concern. Still instead of changing the page to "fit all sizes", you should have a separate page for such devices.


Not sure about tt (I guess you can use). But b, i should be replaced by strong and em respectively.

big and small should not be used IMO and be replaced by alternative tags depending on the semantics.

Dmytrii Nagirniak
i'm not talking about <big> and <small> as use as a Heading. i'm asking if we use inline. like if we use <big> over <span class="big"> then without css, text will still look bold.
metal-gear-solid
I am not talking about `big` and `small` to use in headings either. The question was "Should we consider how page will look with no CSS". The answer is No. And as you can see I provided explanation why.
Dmytrii Nagirniak