Bold, italic, break
Web Basics — HTML & CSS Lesson 3 2:07 English narration · English + 中文 subtitles burned in
Chapters
Transcript
Until now a tag has wrapped a whole block: this line is a paragraph, this line is a heading.
到现在为止,标签包裹的都是一整块: 这一行是段落,这一行是标题。
Here is something new — a tag that wraps just one word in the middle of a sentence.
现在有个新东西——一个只包住句子中间某一个词的标签。
Everything around it stays exactly as it was.
它周围的一切都保持原样。
And notice what happens on the page: the tags disappear, as they always do, leaving one word that stands out from its neighbours.
再看页面上发生了什么: 标签像往常一样消失了, 留下的是一个从邻居中间凸显出来的词。
There are two of these worth knowing.
其中有两个值得掌握。
Strong marks a word as important, and the browser draws it bold.
strong 把一个词标记为“重要”,浏览器把它画成粗体。
Em marks a gentler emphasis, and the browser draws it italic.
em 表示一种更轻的强调,浏览器把它画成斜体。
Now, you might ask why they are not simply called bold and italic.
你可能会问,为什么不干脆叫粗体和斜体。
Because a screen reader can hear the difference: it can say an important word differently.
因为屏幕阅读器能“听”出区别: 它可以把一个重要的词读得不一样。
The tag says what the word MEANS; how it looks is the browser's answer to that.
标签说的是这个词的“含义”, 它长什么样,是浏览器对这个含义的回应。
And now the first tag that breaks the pairing rule.
现在来看第一个打破“成对”规则的标签。
The br tag forces a new line, and it wraps nothing at all, so there is nothing to close — you write it once and that is the whole tag.
br 强制换到新的一行,而它什么都不包裹, 所以也就没有什么需要闭合的——你只写一次,整个标签就完了。
Use it inside a poem, or an address, where the lines belong together.
在诗歌里、在地址里用它,那些行本来就属于同一段。
It is still one paragraph, just printed on two lines, which is exactly what a second paragraph would NOT give you.
它依然是一个段落,只是打印成了两行, 而这恰恰是再写一个段落做不到的。
The first task asks you to bold the single word fresh, and the mistake to avoid is wrapping the whole sentence instead.
第一道题要你把 "fresh" 这一个词加粗, 要避免的错误是把整句话都包进去。
Look at what that does.
看看那样会怎样。
When every word is bold, no word is bold — emphasis works by contrast, so if you emphasise everything you have emphasised nothing.
当每个词都是粗体时,就没有哪个词是粗体了—— 强调靠的是对比, 所以如果你强调了一切,你就什么也没强调。
Four things to take with you.
带走四点。
One: strong marks important words, and looks bold.
第一:strong 标记重要的词,看起来是粗体。
Two: em marks emphasis, and looks italic.
第二:em 表示强调,看起来是斜体。
Three: wrap only the word you mean, right inside the sentence.
第三:只包住你真正想强调的那个词,就在句子里面。
Four: br breaks a line and has no closing tag.
第四:br 用来换行,而且没有结束标签。
Now do both tasks.
现在把两道题都做一下。