私はプログラミングとウェブデザインの初心者で、ウェブサイトを作成しようとしています。私の出演予定は、
だから、私が使用するコードは
<body>
<div id="header">
</div>
<div id="content">
</div>
<div id="footer">
</div>
<script>
function getWidth()
{
xWidth = null;
if(window.screen != null)
xWidth = window.screen.availWidth;
if(window.innerWidth != null)
xWidth = window.innerWidth;
if(document.body != null)
xWidth = document.body.clientWidth;
return xWidth;
}
function getHeight() {
xHeight = null;
if(window.screen != null)
xHeight = window.screen.availHeight;
if(window.innerHeight != null)
xHeight = window.innerHeight;
if(document.body != null)
xHeight = document.body.clientHeight;
return xHeight;
}
</script>
</body>
その後、.css ファイルを作成しました (まだ空です)。したがって、読者の画面から利用可能な幅と高さを取得し、数値を計算した後、利用可能な幅と高さに対する div を表示する Web サイトを作成したいと考えています。たとえば、小さなボックスには height=width=5%available があります.width_of_screen. すべての小さなボックスがプロジェクトまたは投稿になります。
だから、私の質問は次のとおりです。私のウェブサイトの数値を計算するために、外部CSSで変数のデータを渡すにはどうすればよいですか?
ありがとう、ガブリエル