I've heard that putting a block element inside an inline element is an HTML error:
< Code> & lt; A href = "http://www.mydomain.com" & gt; & Lt; Div & gt; We have a problem here, you see, an anchor element is an inline element, and the div element is a block level element & lt; / Div & gt; & Lt; / A & gt;
But what if you style the external anchor in the stylesheet as display: block
? Is it still wrong? The HTML 4.01 seems to be on the spec:
Style sheets provide means to specify the rendering of arbitrary elements, including whether the element is provided as a block or inline is. In some cases, such as an inline style for list elements, it may be appropriate, but generally, the authors are so discouraged from overriding the traditional interpretation of HTML elements like this.
Anyone else have more suggestions about this issue?
Depending on the version of HTML you are eating:
- < Li>
-
specifies that
can be included in an
element
one, so it can not appear inside a, & lt; a & gt;
.Of course, you are free to style Inline elements like this Q is a block, or indeed a block style so that it can be provided inline. For documents using the
inline
andblocks
in HTML The meaning refers to the relationship of elements of the structure, whereas the same word in css is more related to the visual styling of elements. If you display inline elements in a blocked way, then it is okay.Although you sure It should be noted that the structure of the document is still understood when CSS is not present, for example when a screen reader can be reached through an assistive technology - or indeed when tested by powerful Googlebot.
indicates that & lt; A & gt;
element can be wrapped around whole paragraphs, lists, tables and much more, even until the whole section, unless there is no interactive content (such as buttons or other links).
No comments:
Post a Comment