2016-06-12 8 views
-1

CSSタグを含むhtmlファイルも実行しようとしています。しかし出力では、HTMLタグの出力だけを見ることができ、CSSタグは出力できません。私はすべてのブラウザでこれを試しましたが、何が問題なのか分かりますか?ここでCSSスクリプトが動作しない

<?xml version=”1.0” encoding=”UTF-16”?> 
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN” 
“http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”> 
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en”> 
<head> 
<title>Bohemia</title> 
</head> 
<body> 
<div style=”text-align:center”> 
<h1>Bohemia</h1> 
<h2>by Dorothy Parker</h2> 
</div> 
<p style=”text-align:left”> 
Authors and actors and artists and such<br /> 
Never know nothing, and never know much.<br /> 
Sculptors and singers and those of their kidney<br /> 
Tell their affairs from Seattle to Sydney. 
</p> 
<p style=”text-align:center”> 
Playwrights and poets and such horses’ necks<br /> 
Diarists, critics, and similar roe<br /> 
Never say nothing, and never say no. 
</p> 
<p style=”text-align:right”> 
People Who Do Things exceed my endurance;<br /> 
God, for a man that solicits insurance! 
</p> 
</body> 
</html> 

(出力)のCSSアライメントタグが機能していない:

は、ここに私のファイルです。

答えて

0

使用している引用符が間違っています。代わりに " 'を使用してみるか:

<!DOCTYPE html> 
 
    <html> 
 
    <head> 
 
     <meta charset="utf-8"> 
 
     <meta name="viewport" content="width=device-width"> 
 
     <title>Bohemia</title> 
 
    </head> 
 
    <body> 
 
    <div style=”text-align:center”> 
 
    <h1>Bohemia</h1> 
 
    <h2>by Dorothy Parker</h2> 
 
    </div> 
 
    <p style='text-align:left'> 
 
    Authors and actors and artists and such 
 
    Never know nothing, and never know much. 
 
    Sculptors and singers and those of their kidney 
 
    Tell their affairs from Seattle to Sydney. 
 
    </p> 
 
    <p style='text-align:center'> 
 
    Playwrights and poets and such horses’ necks 
 
    Diarists, critics, and similar roe 
 
    Never say nothing, and never say no. 
 
    </p> 
 
    <p style='text-align:right'> 
 
    People Who Do Things exceed my endurance; 
 
    God, for a man that solicits insurance! 
 
    </p> 
 
    </body> 
 
    </html>

0

使用<div style='text-align:center'>代わりにこの

<div style=”text-align:center”>, 

の私たちは、このよう<div style=”text-align:center”>を使用している場合、 ブラウザは<div style="”text-align:center”"></div> として取るので、スタイルが検討しています文字列として使用する( "")またはこれを使用しない( '')

関連する問題