私は個人的な使用のために Web サイトに取り組んでおり、スプラッシュ ページを作成しました。ページを少し分割するために、いくつかの行を含む画像がいくつかあります。スプラッシュページはこちら。
私が抱えている主な問題は、CSS 内で各要素の位置に絶対位置を使用したことです。視聴者が使用する画面によっては、中央ではなく左右に配置されることは明らかです。中央の開始点を使用し、相対位置を使用することを考えました。それは正しい降り方でしょうか?
画面の解像度に関係なく、要素を中央に配置し、その「形成」を実現する特定の方法はありますか?
HTML
<DOCTYPE html>
<html>
<head>
<title>Daniel Hopkins Personal Website</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div class="hr_top"> </div>
<div class="hr"> </div>
<div class="hr_bot"> </div>
<center>
<div class="logo">
<img src="logo.png"/>
</div>
<div class="logoname">
<img src="logoname2.png"/>
</div>
<div class="enter"><b><a href"home.html">Enter</a></b>
</div>
</body>
</html>
CSS
body {}
.hr {
width:2px;
height:350px;
background-color:#000000;
position:absolute;
top:140px;
left:884px;
z- index:10;
background: -webkit-linear-gradient(white, black, white);
}
.logo {
position:absolute;
top:200px;
left:640px;
z-index:10;
}
.logoname {
position:absolute;
top:260px;
left:900px;
z-index:10;
}
.hr_top {
width:600px;
height:2px;
position:absolute;
top:180px;
left:640px;
z-index:10;
background: -webkit-linear-gradient(left, white, black, white);
}
.hr_bot {
width:600px;
height:2px;
background-color:#000000;
position:absolute;
top:442px;
left:640px;
z-index:10;
background: -webkit-linear-gradient(left, white, black, white);
}
.enter {
position:absolute;
top:400px;
left:910px;
z-index:10;
font-size:22px;
font-variant:small-caps;
font-style:bold;
font-family:Helvetica;
color:black;
}
a:link {
text-decoration:none;
color:#000000;
}
/* unvisited link */
a:visited {
text-decoration:none;
color:#000000;
}
/* visited link */
a:hover {
text-decoration:underline;
color:#000000;
}
/* mouse over link */
a:active {
text-decoration:underline;
color:#000000;
}
/* selected link */