Obsolete and deprecated HTML4 elements
this wiki
Forum page
This Forum has been archived
Visit the new ForumsTo contact staff directly or to report bugs, please use Special:Contact.
So I was reading the blog post and associated link and just wanted to check that I understood correctly what I was reading, and then ask what to do instead.
So am I right in thinking that, with HTML5, the following codes will not work:
<big>text</big><center>text</center><font color="red">text</font><strike>text</strike><br style="clear: both;" />
If so, what are the best alternatives?
Thanks, Enodoc(Talk) (Eno@Fable) 18:38, July 5, 2012 (UTC)
- Everything above excluding
<br style="clear:both;" />will not work after the upgrade to HTML5. This table provides the best alternatives for each.
| Soon to be obsolete | Alternative |
<big>text</big>
| <span style="font-size:larger;">text</span>
|
<center>text</center>
| <span style="text-align:center;">text</span>
|
<font color="red">text</font>
| <span style="color:red;">text</span>
|
<strike>text</strike>
| <s>text</s> or <span style="text-decoration:line-through;">text</span>
|
<br clear=all />
| <br style="clear:both;" />
|
Note that the above declarations can all be fitted into a style attribute on any element or into MediaWiki CSS files. This is perfectly valid:
<!-- I want this box to be in the center of the page and have its content centered as well --> <div style="border: 1px solid blue; margin: auto; text-align: center; color: royalblue; font-size: large; text-decoration: line-through;"> Hello World! </div>
Hello World!
For further CSS references, see w3schools. TK999 18:56, July 5, 2012 (UTC)
- Thanks guys, I thought they'd probably be covered by
styleI just wasn't sure of the exact codes. --Enodoc(Talk) 19:31, July 5, 2012 (UTC)
- Just an FYI, <big> is also equivalent to 120% font-size (which is shorter than 'larger'). Rappy 21:56, July 5, 2012 (UTC)
So
<br clear=all />
will no longer work? -- 70.49.127.65 07:00, July 6, 2012 (UTC)
- Wow is that true? Where is written that? I usually tend to add the semicolon even if there is one propriety or it's the last one...
leviathan_8919:41, 8 July, 2012 (UTC)
- Wow is that true? Where is written that? I usually tend to add the semicolon even if there is one propriety or it's the last one...
(Reset indent) "End all CSS declarations with a semicolon - ;"
That is what the W3C recommends.
Google recommends it too btw. pecoes 19:56, July 08, 2012 (UTC)
- First of all, that is CSS. CSS is not HTML. Also, try to add a code that matches HTML5 standards with
<span style="font-size:120%;"></span>or another use of style in an HTML tag and see if it validates. I've tried it and it didn't. —This unsigned comment is by MateyY (wall • contribs) . Please sign your posts with ~~~~!
(Reset indent)
Seem strange that <small> is still supported, but not <big>. -- Fandyllic (talk · contr) 12 Jul 2012 10:37 AM Pacific
- I think it's for pragmatic reasons. Whatever it's caused by, in HTML 5, it defines side comments, so it has a semantic value. See the relevant specs for details and when not to use. TK999 18:42, July 12, 2012 (UTC)
- "small" was redefined to mean small-print in HTML5, instead of small size, the result is still the same, the semantic meaning was changed. Still "big" should have been redefined this way as well ("big print", like in adverts) -- 76.65.131.160 06:58, July 13, 2012 (UTC)