Comments on: “Block-level” links in HTML5 https://stevefaulkner.github.io/html5doctored/block-level-links-in-html-5/ helping you implement HTML5 today Thu, 28 Jul 2016 17:36:34 +0000 hourly 1 By: Savannah https://stevefaulkner.github.io/html5doctored/block-level-links-in-html-5/#comment-2095571 Thu, 25 Feb 2016 05:58:19 +0000 http://html5doctor.com/?p=455#comment-2095571 This is pretty useful but do you use the block-level in just links or is it used in other things?

]]>
By: CJ https://stevefaulkner.github.io/html5doctored/block-level-links-in-html-5/#comment-2061530 Fri, 27 Nov 2015 03:57:13 +0000 http://html5doctor.com/?p=455#comment-2061530 6 years later and some rich text editors (eg; CKEditor) still won’t allow this markup.

Instead, they will unhelpfully place the anchor ‘inside’ each block element.

*sigh*

]]>
By: SelenIT https://stevefaulkner.github.io/html5doctored/block-level-links-in-html-5/#comment-1904890 Wed, 06 May 2015 08:43:43 +0000 http://html5doctor.com/?p=455#comment-1904890 Aik Boba, the HTML4 and earlier clearly defined the content model of <a> element as ‘inline’:

<!ELEMENT A – – (%inline;)* -(A) — anchor –>

So all elements not listed in ‘inline’ definition weren’t allowed inside it.

]]>
By: Aik Boba https://stevefaulkner.github.io/html5doctored/block-level-links-in-html-5/#comment-1899334 Sun, 03 May 2015 14:42:47 +0000 http://html5doctor.com/?p=455#comment-1899334 Guys, I don’t see trouble to use block-level links in html of earlier versions (4 and low). Reed W3 specification: http://www.w3.org/TR/html4/struct/links.html – there are restricted tag in only :) So… I don’t know what this article for.

]]>
By: Praky https://stevefaulkner.github.io/html5doctored/block-level-links-in-html-5/#comment-1818378 Tue, 31 Mar 2015 12:52:10 +0000 http://html5doctor.com/?p=455#comment-1818378 Is there any workaround for the issue that @Gabriel has pointed out? I’m facing a similar issue.

]]>
By: Gabriel Luethje https://stevefaulkner.github.io/html5doctored/block-level-links-in-html-5/#comment-1401195 Tue, 06 Jan 2015 17:36:44 +0000 http://html5doctor.com/?p=455#comment-1401195 I’m glad this is not considered “verboten” anymore, because it really comes in handy, especially for avoiding the repetitious “read more” links on excerpts.

I have, however, come across an issue that makes me think twice before wrapping a bunch of things in an a tag: it can make text inside of those elements difficult or impossible to select.

When you go to click and drag, it activates the link instead of selecting the text within. If you start your drag outside of the anchor tag it tends to work OK, but if you have a grid of anchor tags with text elements inside and little or no margin between them, it can be next to impossible to select the text.

Here’s an example (try to select the text in the blocks).

]]>
By: PhilK https://stevefaulkner.github.io/html5doctored/block-level-links-in-html-5/#comment-128045 Thu, 17 Jul 2014 16:45:50 +0000 http://html5doctor.com/?p=455#comment-128045 Thanks Dr. Bruce that’s what I’ve been using but to center a table one needs to put that in a div, or to center a block such as a user control one needs to put that in a div with the width being the same (or very close to it) as the user control “inside” the div. It is such a pain! Why can’t they add block-align similar to text-align? Oh-well, not your problem.

Thanks again.

]]>
By: Bruce Lawson https://stevefaulkner.github.io/html5doctored/block-level-links-in-html-5/#comment-127575 Thu, 17 Jul 2014 12:42:27 +0000 http://html5doctor.com/?p=455#comment-127575 To centre stuff, you use CSS, as that’s the language to describe presentation. For block-level elements, use {margin:0 auto}.

]]>
By: PhilK https://stevefaulkner.github.io/html5doctored/block-level-links-in-html-5/#comment-124277 Wed, 16 Jul 2014 13:13:36 +0000 http://html5doctor.com/?p=455#comment-124277 Oops, I didn’t pay attention to the HTML allowed, let’s try again:

In all probablility it’s just that I haven’t found the correct way to do this yet, but how does one center a block element using HTML5?

In older HTML we could center a block element using align=”center” within a table <td> tag but this is no longer in HTML5 so what’s a coder to do?

I’d also like to see this in CSS, how about a corresponding “block-align:center” method?

Case in point, I want a block element to be centered within another element, say a <td> of a table. I can now use

<colgroup>
<col style="width:40%; text-align:center;">
</colgroup>

and the text in the corresponding <td> aligns correctly, BUT if I put a block element within that TD it is NOT centered.

So, why isn’t there a corresponding block-align element?

<colgroup>
<col style="width:40%; block-align:center;">
</colgroup>

or at least some way in HTML5 to align a block on the page without using deprecated, no longer allowed methods such as <td align=”center”> ?

What am I missing, haven’t found yet?

Thanks!
PhilK

]]>
By: Jakob E https://stevefaulkner.github.io/html5doctored/block-level-links-in-html-5/#comment-44787 Thu, 23 Jan 2014 07:38:30 +0000 http://html5doctor.com/?p=455#comment-44787 @Gus I do the same – hence I like :)

]]>