?
本文檔使用 php中文網(wǎng)手冊 發(fā)布
<samp>元素用于標(biāo)識計算機程序輸出,通常使用瀏覽器缺省的 monotype 字體(例如 Lucida Console)。
內(nèi)容類別 | Flow content, phrasing content, palpable content. |
---|---|
允許的內(nèi)容 | Phrasing content. |
標(biāo)記遺漏 | 沒有,起始和結(jié)束標(biāo)簽都是強制性的。 |
允許父級 | 任何接受 phrasing content.的元素。 |
允許ARIA角色 | 任何 |
DOM界面 | HTML元素 |
這個元素只包含全局屬性。
常規(guī)文本,然后是示例輸出,然后再定期文本。
<p>The diet-tracking app said: <samp>You're not eating your veggies</samp> and that was true</p>
The diet-tracking app said: You're not eating your veggies. and that was true.
Specification | Status | Comment |
---|---|---|
HTML Living StandardThe definition of '<samp>' in that specification. | Living Standard | |
HTML5The definition of '<samp>' in that specification. | Recommendation | |
HTML 4.01 SpecificationThe definition of '<samp>' in that specification. | Recommendation |
可以為samp
選擇器定義CSS規(guī)則來覆蓋瀏覽器的默認(rèn)字體。用戶設(shè)置的首選項可能優(yōu)先于指定的CSS。
Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic Support | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
Feature | Android | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
---|---|---|---|---|---|---|---|
Basic Support | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |