【CSS11】
</html><?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-style-type" content="text/css" />
<title>CSS11|</title>
<style type="text/css" media="screen, print" />
p {
color: #FFF;
background-color: #009EFF;
width: 350px;
margin: 50px;
}
</style>
</head>
<body>
<p>BOX and margin<br>
この領域はボックスといいます。テキストなどのコンテンツ内容を表示する領域です。マージンはこのボックスの余白のことをいいます。</p>
</body>
</html>
【CSS12】
- この場合、リセットはしない
- 左右均等空き(上下空きは指定しない)
</html><?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-style-type" content="text/css" />
<title>CSS11|</title>
<style type="text/css" media="screen, print" />
*{
font-family:
"ヒラギノ角ゴ Pro W3",
"Hiragino Kaku Gothic Pro",
"Hiragino Kaku Gothic Pro W3",
"メイリオ",
Meiryo,
Osaka,
"MS Pゴシック",
"MS PGothic",
sans-serif;
}
p {
color: #FFF;
background-color: #009EFF;
width: 300px;
border: solid 5px #F9CB04;
margin: 0 50px;
}
</style>
</head>
<body>
<p>BOX and margin<br>
この領域はボックスといいます。テキストなどのコンテンツ内容を表示する領域です。マージンはこのボックスの余白のことをいいます。</p>
</body>
</html>
【CSS13】
</html><?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-style-type" content="text/css" />
<title>CSS11|</title>
<style type="text/css" media="screen, print" />
*{
font-family:
"ヒラギノ角ゴ Pro W3",
"Hiragino Kaku Gothic Pro",
"Hiragino Kaku Gothic Pro W3",
"メイリオ",
Meiryo,
Osaka,
"MS Pゴシック",
"MS PGothic",
sans-serif;
}
body {
background-image: url("images/css13.jpg");
background-repeat: repeat-y;
}
h2 {
color: #FFF;
background-color: #D347CE;
width: 70px;
padding-left: 5px;
}
p {
width: 400px;
margin-left: 70px;;
}
</style>
</head>
<body>
<h2>BOX</h2>
<p>この領域はボックスといいます。テキストなどのコンテンツ内容を表示する領域です。マージンはこのボックスの余白のことをいいます。</p>
</body>
</html>
【CSS14】
</html><?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-style-type" content="text/css" />
<title>CSS11|</title>
<style type="text/css" media="screen, print" />
*{
font-family:
"ヒラギノ角ゴ Pro W3",
"Hiragino Kaku Gothic Pro",
"Hiragino Kaku Gothic Pro W3",
"メイリオ",
Meiryo,
Osaka,
"MS Pゴシック",
"MS PGothic",
sans-serif;
}
h2 {
color: #FFF;
background-color: #629665;
width: 400px;
padding: 10px;
margin-bottom: 0;
}
p {
color: #FFF;
background-color: #96CA99;
width: 400px;
padding: 10px;
margin-top: 0;
}
</style>
</head>
<body>
<h2>BOX</h2>
<p>この領域はボックスといいます。テキストなどのコンテンツ内容を表示する領域です。マージンはこのボックスの余白のことをいいます。</p>
</body>
</html>
【CSS15】
- この場合、リセットはしない
- 空きは、すべて50px
</html><?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-style-type" content="text/css" />
<title>CSS11|</title>
<style type="text/css" media="screen, print" />
*{
font-family:
"ヒラギノ角ゴ Pro W3",
"Hiragino Kaku Gothic Pro",
"Hiragino Kaku Gothic Pro W3",
"メイリオ",
Meiryo,
Osaka,
"MS Pゴシック",
"MS PGothic",
sans-serif;
}
p {
color: #6BA3B0;
border: solid #CCCCCC;
border-width: 20px 10px;
width: 400px;
padding: 50px;
}
</style>
</head>
<body>
<p>BOX and PADDING</br>
この領域はボックスといいます。テキストなどのコンテンツ内容を表示する領域です。マージンはこのボックスの余白のことをいいます。</p>
</body>
</html>