【CSS05】
【CSS05】
・背景色と余白
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/> <meta http-equiv="Content-Style-Type"content="text/css"/> <title>【CSS05】</title> <style type="text/css"> <!-- } h2 { color: #fff; font-size: 1.0em; background-color: #1565b5; } p { font-size:0.875em; background-color:#bdd4eb; } h2,p { margin:0; padding:1.0em; } --> </style> </head> <body> <h2>background-colorの設定</h2> <p>見出しには濃いめの色を背景に指定し、文字を白抜きにします。段落には見出しよりも薄い色を指定します。さらに見出しと段落の上下のマージンを0にして、ボックスの上下をくっつけ、パディングを1em指定します。 </p> </body> </html>