假設我在foo.html文件中像這樣的文字:我可以使用「原樣」文本製作css div嗎?
All the World's a Stage
All the world's a stage,
And all the men and women merely players;
They have their exits and their entrances,
And one man in his time plays many parts,
His acts being seven ages. At first, the infant,
Mewling and puking in the nurse's arms.
Then the whining schoolboy, with his satchel
And shining morning face, creeping like snail
Unwillingly to school. And then the lover,
Sighing like furnace, with a woeful ballad
Made to his mistress' eyebrow.
注意空格和換行。我可以把它放到div
,並保持它與CSS一樣嗎?
All the World's a Stage All the world's a stage, And all the men and women merely players; They have their exits and their entrances, And one man in his time plays many parts, His acts being seven ages. At first, the infant, Mewling and puking in the nurse's arms. Then the whining schoolboy, with his satchel And shining morning face, creeping like snail Unwillingly to school. And then the lover, Sighing like furnace, with a woeful ballad Made to his mistress' eyebrow.
我想是非常接近<pre>
標籤的行爲,我認爲:不是所有文本作爲在一起的時候,你把一個HTML頁面它的發生。
爲什麼不使用預標籤呢? – 2015-03-02 17:31:15