私はすでにこの質問をしましたが、具体的な答えは得られませんでした。だから私は質問の簡略化されたバージョンを尋ねると思った
ウェブサイトを作成していて、div を特定の高さに配置したいと考えています。ブラウザウィンドウのサイズが変更され、divがそのpxにとどまるように、マージントップをpx単位で設定することはできません。これを % で指定しました。margin-top が px の場合、すべてのブラウザーで問題ありませんが、% の場合、IE9 IE10 と FF はおかしな動作をします。
以下のコードは非常に単純で、難しいことは何もありません。cssのリセットも試しましたがダメでした。誰でも少し時間を割いて、これで私を助けてくれませんか。
現在、インターネットからではなくハードディスクからページをロードしています。
ありがとう
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>Train of Thought</title>
<style type="text/css">
div.content {
height:200px;
visibility:visible;
border-style: none;
display: block;
position: fixed;
text-align: center;
z-index: 1;
padding-top: 0px;
border-top: 0px;
padding-bottom: 0px;
border-bottom: 0px;
background-color: #00FFFF;
font-family:Arial,sans-serif;
overflow: auto;
margin-left: 23%;
margin-right:25%;
font-size:150%;
margin-top: 40%;
}
</style>
</head>
<body>
<div class="content">This div is supposed to be same in all the browsers. but thisis different in them. IE9 and FF display it in lower bottom of the page while chrome displays in the middle.
<br>This div is supposed to be same in all the browsers. but thisis different in them. IE9 and FF display it in lower bottom of the page while chrome displays in the middle.
</div>
</body>
</html>