These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:03 pm Advanced search

Blockcode tag

Do you think the HTML spec should do something differently? You can discuss spec feedback here, but you should send it to the WHATWG mailing list or file a bug in the W3C bugzilla for it to be considered.

Blockcode tag

Postby peroyomas » Wed May 26, 2010 2:16 pm

I would like if they added the
Code: Select all
blockcode
tag as a shortcut for
Code: Select all
<pre><code>
. It's the same quantity of characters, but a single tag is less cumberstome.

Is said that is not going to be added because is "not backwards compatible with previous specs", but there's also many new elements that aren't supported by earlier browsers; and both inline and block elements with different CSS properties.
User avatar
peroyomas
<h6>
 
Posts: 7
Joined: Wed Jul 08, 2009 8:22 pm
Location: Chile

Re: Blockcode tag

Postby zcorpan » Thu Mar 31, 2011 7:37 pm

There's a high cost to adding a new element. If the use case is already served by <pre><code>, and there isn't huge benefit from <blockcode>, then it's not worth it.
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Re: Blockcode tag

Postby JAB Creations » Thu Mar 31, 2011 8:58 pm

Those are elements, not tags. A tag is the starting or ending portion of an element therefore 99.9% of the time it is professional to refer to these as elements. The only condition I can think of that it would be professional to refer to a tag is if you're referring to self-closing elements (e.g. do I need a closing tag for the br or img elements?).

Just apply the CSS white-space property as you see fit. Here is a slimmed down example from my website of how I handle the code element's formatting...

Code: Select all
code {white-space: pre;}
div code {display: block;}
div p code, div span code, li code {display: inline;}
User avatar
JAB Creations
<aside>
 
Posts: 566
Joined: Tue Mar 13, 2007 4:48 am
Location: Sarasota Florida, USA

Re: Blockcode tag

Postby zcorpan » Thu Mar 31, 2011 9:19 pm

JAB Creations wrote:Those are elements, not tags. A tag is the starting or ending portion of an element therefore 99.9% of the time it is professional to refer to these as elements. The only condition I can think of that it would be professional to refer to a tag is if you're referring to self-closing elements (e.g. do I need a closing tag for the br or img elements?).
LOL will you stop whining about elements/tags? :lol: Or write a sticky about it and be done with it. I bet you're putting people off and making them leave the forum by saying they're unprofessional for saying 'tag' - most people don't care and we still know what they mean.

JAB Creations wrote:Just apply the CSS white-space property as you see fit. Here is a slimmed down example from my website of how I handle the code element's formatting...

Code: Select all
code {white-space: pre;}
div code {display: block;}
div p code, div span code, li code {display: inline;}

If the whitespace is important (e.g. in Python it's part of the syntax), then you should use <pre> rather than CSS since CSS is optional.
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden


Return to Feedback on the Specs

Who is online

Users browsing this forum: No registered users and 1 guest