短语内容和流内容之间有什么区别? [英] What is the difference between phrasing content and flow content?

查看:113
本文介绍了短语内容和流内容之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是HTML和CSS的新手,我想知道流量内容和短语内容之间的区别。除了W3官方文档,可以在一个句子,所以它的措辞。但是从HTML 5开始,还允许有一个包含整个文本块的链接,在这种情况下它不是短语。



短语内容分为三类:


  1. 视觉上替换的内容。 (例如< img> 由图片替换。

  2. 包含正文中的文字的内容。

  3. 提供有关运行中特定文本元数据的内容(例如< link> 用于 itemprop 中的而不是< link>


  4. 流内容包括短语内容,还包括元素如 < p> < h1 >定义整个文本行,< article& c $ c>其中包含一个或多个运行和< table> ,其中包含包含文本运行的单元格行。


    $ b b


    在高级CSS中,知道不同种类的内容,而不仅仅是它的定义,或者只是在某种类型的内容下面的元素列表是非常关键的, 为什么某个元素属于某个类别,以及在类似内容类别之间的主要区别是什么,在我的问题的情况下,定相内容和流内容之间的区别。


    我不完全同意。



    这是绝对必要知道这一点。这是在写入< html>< head>< title> Hello< / title>< / head>< body>< p&世界!< / p>< / body>< / html> ,并在浏览器中打开它,HTML中有几个不同的元素。它可能不会变得完全清楚,直到一个人已经学习的元素是每个的例子,但让他的头围是重要的,因为很多东西只是没有意义,否则,它使一个简单的标记语言与容易记住的元素和属性和一个杂乱的汤标签,你永远不会记得为什么验证者说你做错了。



    现在你的CSS (大多数可见的短语内容是替换元素或 display:inline; ,大多数其他流内容是或者 display:block; 或者明显与语义相关的东西(例如 tr:{display:table-row;} )。



    但是因为HTML是您首先想到的语义,所以在编写CSS时,您可以更专注于渲染,当然,正确的语义不应该通常成为对CSS的限制,而不是简单的事实,你显然需要一个可视化设计来帮助你的消息。



    因此,例如,因为< p> 被定义为一个段落,在我们的文化段落中今天通常排版为文本块,他们或第一行上的缩进,并不意味着我们必须遵循这条规则。我们可以将后期中介风格的段落布局为这里,段落之间用pilcrows隔开。



    不是你可能想这样做,但你当然可以。因此,尽管好的CSS是建立在元素的语义上的,但它也使我们免于它们,因为我们不必有不正确的语义,以便像我们想要的那样看起来(或声音)。


    I am new to HTML and CSS and I would like to know the difference between flow content and phrasing content. Other than the W3 official documentation the MDN documentation is helpful and states:

    Flow content is defined as following:

    Elements belonging to the flow content category typically contain text or embedded content.

    Phrasing content is defined as following:

    Phrasing content defines the text and the mark-up it contains. Runs of phrasing content make up paragraphs.

    However, the documentation gives very little difference between the two, can somebody clarify what the major differences are between phrasing content and flow content?

    解决方案

    The easiest way to remember, is that if it can be inside a sentence, it's phrasing content.

    Text can be inside a sentence, so it's phrasing.

    An emphasised bit can be inside a sentence, so it's phrasing.

    An image can be inside a sentence, so it's phrasing.

    A sub-heading or an article cannot be inside a sentence, so they are not phrasing.

    A link can be inside a sentence, so it's phrasing. But as of HTML 5, one is also allowed to have a link containing whole blocks of text, in which case it is not phrasing.

    Phrasing content falls into three categories:

    1. Content that is replaced by something visually. (E.g. as <img> is replaced by an image.
    2. Content that contains text within a run.
    3. Content that provides metadata about a specific piece of text within a run. (E.g. <link> when used with itemprop rather than <link> in the <head> which defines a relationship between a document as a whole and the resource linked to).

    Flow content includes phrasing content, but also elements like <p> and <h1> which define a whole run of text, <article> which contains one or more runs and <table> which contains rows of cells which contain runs of text.

    It is very critical in advanced CSS to know the different kinds of content and not just the definition of it , or just the list of elements that come under a certain type of content , but also "Why" a certain element comes under a certain category and whats the major difference between similar content categories , in the case of my question , whats the difference between "Phasing content" and "Flow content".

    I don't entirely agree.

    It's absolutely vital to basic HTML to know this. It's the very first thing that should be taught in HTML after writing <html><head><title>Hello</title></head><body><p>Hello World!</p></body></html> in a text editor and opening it in a browser, and "there are several different elements in HTML". It may not become fully clear until one has then learnt the elements that are examples of each, but getting one's head around it is important as a lot of things just don't make sense otherwise and it makes the difference between a simple markup language with easy-to-remember elements and attributes and a messy soup of tags where you can never remember why validators are saying you're doing it wrong.

    Now certainly, your CSS is going to generally follow from your semantics, and the defaults follow from them too (most visible phrasing content is either a replaced element or display: inline;, most other flow content is either display: block; or something that relates quite obviously to the semantics (e.g. tr: {display: table-row;}).

    But because the HTML is where you think first about the semantics, when writing the CSS you can focus more on just the rendering, and to a degree free yourself from that concern. Certainly, correct semantics should not generally become a restriction upon the CSS beyond the simple fact that you obviously want a visual design that helps your message get across.

    So for example, just because <p> is defined as "a paragraph" and in our culture paragraphs are today generally typeset as blocks of text with either a vertical margin between them or an indent on the first line, does not mean we have to follow that rule. We can layout our paragraphs in late-mediæval style like here with paragraphs running together separated by pilcrows.

    Not that you are likely to want to do so, but you certainly can. So while good CSS does build on the semantics of the elements, it also frees us from them in that we don't have to have incorrect semantics in order to have something look (or sound) like we want.

    这篇关于短语内容和流内容之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆