>説明のページへ戻る
>前のソース
>次のソース
Internet Explorer 5対策をする。
ひとまずtext-indent: -9999px;をtext-indent: 0;にする。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<title>HTMLサンプル</title>
<meta http-equiv="content-style-type" content="text/css">
<style type="text/css">
<!--
html {
width: 100%;
}
body {
background-color: #000;
margin: 0;
padding: 0;
width: 100%;
}
#allcontent {
width: 760px;
margin: 0 auto;
}
#head {
width: 760px;
margin: 0;
padding: 0;
}
#contents {
width: 760px;
margin: 0;
padding: 0;
}
#foot {
width: 760px;
margin: 0;
padding: 0;
}
#head ul{
list-style-type : none;
margin: 0;
padding: 0;
}
#head li{
list-style-type : none;
margin: 0;
padding: 0;
float:left;
text-indent: -9999px;
font-size:0;
line-height: 0;
}
li#logo_top a {
text-decoration: none;
display: block;
width: 135px;
height: 65px;
background: transparent url(img/logo_2.gif) 0 0 no-repeat ;
}
li#menu1 a,li#menu2 a,li#menu3 a,li#menu4 a,li#menu5 a {
text-decoration: none;
display: block;
width: 125px;
height: 65px;
}
li#menu1 a {
background: transparent url(img/menu_1s.gif) 0 0 no-repeat ;
}
li#menu2 a {
background: transparent url(img/menu_2s.gif) 0 0 no-repeat ;
}
li#menu3 a {
background: transparent url(img/menu_3s.gif) 0 0 no-repeat ;
}
li#menu4 a {
background: transparent url(img/menu_4s.gif) 0 0 no-repeat ;
}
li#menu5 a {
background: transparent url(img/menu_5s.gif) 0 0 no-repeat ;
}
li#logo_top a:hover,li#menu1 a:hover,li#menu2 a:hover,li#menu3 a:hover,li#menu4 a:hover,li#menu5 a:hover {
background-position: 0 -70px;
}
h2#mainimg {
margin: 0;
padding: 0;
text-indent: -9999px;
font-size:0;
line-height: 0;
display: block;
width: 760px;
height: 200px;
background: transparent url(img/top_img.gif) 0 0 no-repeat ;
}
#info ul{
list-style-type : none;
margin: 0;
padding: 0;
}
#info li{
list-style-type : none;
width: 380px;
margin: 0;
padding: 0;
float:left;
text-indent: -9999px;
font-size:0;
line-height: 0;
}
li#corp_outline a {
text-decoration: none;
display: block;
margin-left: auto;
width: 75px;
height: 20px;
background: transparent url(img/info_1_3.gif) 0 0 no-repeat ;
}
li#inq a {
text-decoration: none;
display: block;
margin-right: auto;
width: 97px;
height: 20px;
background: transparent url(img/info_2_3.gif) 0 0 no-repeat ;
}
li#corp_outline a:hover,li#inq a:hover {
background-position: 0 -25px;
}
#copyright {
clear:both;
margin: 0;
padding: 0;
text-indent: -9999px;
font-size:0;
line-height: 0;
}
#copyright a {
margin: 0 auto;
display: block;
width: 125px;
height: 20px;
background: transparent url(img/copyright_3.gif) 0 0 no-repeat ;
}
#copyright a:hover {
background-position: 0 -25px;
}
#head li {
text-indent: 0;
}
h2#mainimg {
text-indent: 0;
}
#info li {
text-indent: 0;
}
#copyright {
text-indent: 0;
}
-->
</style>
</head>
<body>
<div id="allcontent">
<div id="head">
<ul>
<li id="logo_top"><a href="#">kikkyのパソコンQ&A</a></li>
<li id="menu1"><a href="#">メニュー1</a></li>
<li id="menu2"><a href="#">メニュー2</a></li>
<li id="menu3"><a href="#">メニュー3</a></li>
<li id="menu4"><a href="#">メニュー4</a></li>
<li id="menu5"><a href="#">メニュー5</a></li>
</ul>
</div>
<div id="contents">
<h2 id="mainimg">イメージ</h2>
</div>
<div id="foot">
<div id="info">
<ul>
<li id="corp_outline"><a href="#">企業概要</a></li>
<li id="inq"><a href="#">お問い合わせ</a></li>
</ul>
</div>
<div id="copyright">
<a href="#">コピーライト</a>
</div>
</div>
</div>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<title>HTMLサンプル</title>
<meta http-equiv="content-style-type" content="text/css">
<style type="text/css">
<!--
html {
width: 100%;
}
body {
background-color: #000;
margin: 0;
padding: 0;
width: 100%;
}
#allcontent {
width: 760px;
margin: 0 auto;
}
#head {
width: 760px;
margin: 0;
padding: 0;
}
#contents {
width: 760px;
margin: 0;
padding: 0;
}
#foot {
width: 760px;
margin: 0;
padding: 0;
}
#head ul{
list-style-type : none;
margin: 0;
padding: 0;
}
#head li{
list-style-type : none;
margin: 0;
padding: 0;
float:left;
text-indent: -9999px;
font-size:0;
line-height: 0;
}
li#logo_top a {
text-decoration: none;
display: block;
width: 135px;
height: 65px;
background: transparent url(img/logo_2.gif) 0 0 no-repeat ;
}
li#menu1 a,li#menu2 a,li#menu3 a,li#menu4 a,li#menu5 a {
text-decoration: none;
display: block;
width: 125px;
height: 65px;
}
li#menu1 a {
background: transparent url(img/menu_1s.gif) 0 0 no-repeat ;
}
li#menu2 a {
background: transparent url(img/menu_2s.gif) 0 0 no-repeat ;
}
li#menu3 a {
background: transparent url(img/menu_3s.gif) 0 0 no-repeat ;
}
li#menu4 a {
background: transparent url(img/menu_4s.gif) 0 0 no-repeat ;
}
li#menu5 a {
background: transparent url(img/menu_5s.gif) 0 0 no-repeat ;
}
li#logo_top a:hover,li#menu1 a:hover,li#menu2 a:hover,li#menu3 a:hover,li#menu4 a:hover,li#menu5 a:hover {
background-position: 0 -70px;
}
h2#mainimg {
margin: 0;
padding: 0;
text-indent: -9999px;
font-size:0;
line-height: 0;
display: block;
width: 760px;
height: 200px;
background: transparent url(img/top_img.gif) 0 0 no-repeat ;
}
#info ul{
list-style-type : none;
margin: 0;
padding: 0;
}
#info li{
list-style-type : none;
width: 380px;
margin: 0;
padding: 0;
float:left;
text-indent: -9999px;
font-size:0;
line-height: 0;
}
li#corp_outline a {
text-decoration: none;
display: block;
margin-left: auto;
width: 75px;
height: 20px;
background: transparent url(img/info_1_3.gif) 0 0 no-repeat ;
}
li#inq a {
text-decoration: none;
display: block;
margin-right: auto;
width: 97px;
height: 20px;
background: transparent url(img/info_2_3.gif) 0 0 no-repeat ;
}
li#corp_outline a:hover,li#inq a:hover {
background-position: 0 -25px;
}
#copyright {
clear:both;
margin: 0;
padding: 0;
text-indent: -9999px;
font-size:0;
line-height: 0;
}
#copyright a {
margin: 0 auto;
display: block;
width: 125px;
height: 20px;
background: transparent url(img/copyright_3.gif) 0 0 no-repeat ;
}
#copyright a:hover {
background-position: 0 -25px;
}
#head li {
text-indent: 0;
}
h2#mainimg {
text-indent: 0;
}
#info li {
text-indent: 0;
}
#copyright {
text-indent: 0;
}
-->
</style>
</head>
<body>
<div id="allcontent">
<div id="head">
<ul>
<li id="logo_top"><a href="#">kikkyのパソコンQ&A</a></li>
<li id="menu1"><a href="#">メニュー1</a></li>
<li id="menu2"><a href="#">メニュー2</a></li>
<li id="menu3"><a href="#">メニュー3</a></li>
<li id="menu4"><a href="#">メニュー4</a></li>
<li id="menu5"><a href="#">メニュー5</a></li>
</ul>
</div>
<div id="contents">
<h2 id="mainimg">イメージ</h2>
</div>
<div id="foot">
<div id="info">
<ul>
<li id="corp_outline"><a href="#">企業概要</a></li>
<li id="inq"><a href="#">お問い合わせ</a></li>
</ul>
</div>
<div id="copyright">
<a href="#">コピーライト</a>
</div>
</div>
</div>
</body>
</html>