开发者

Can't get basic XHTML to display correct in Safari

I'm learning HTML, and have composed the following test file in textedit.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TD/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<title>Testing Safari's html capabilities</title>
</head>
<body>
<h1>Los Angeles Clippers</h1>
<p>The Clippers, owned by frugal Donald Sterling, 
   are always one piece away from be开发者_Go百科ing a piece away from 
   slipping into the playoffs.</p>
</body>
</html>

I save this file as text1 with an html extension, but when I open this in Safari, it shows up as the code itself, not as it would display in a webpage. I also have a DOCTYPE declaration, but I can't get that to show on here without screwing with the code.

'view source' shows that there's some extra things going on up top, but I can't paste what they are precisely because it's difficult to paste html code here without it being translated into the code itself. It shows another DOCTYPE declaration, and then all the code from my file falls into the 'body' section of the html.

Help!


You are probably saving the file in rich text not plain text. See https://discussions.apple.com/thread/1761665?threadID=1761665.


It could be that you're using an editor like Word, which adds more information to a file.

Try using Notepad++ (or regular Notepad) for Windows or TextWrangler in Mac.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜