【CSS015】CSS課題:ボックスモデル
<!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>無題ドキュメント</title> </head> <style type="text/css"> <!-- body { background-color: #999; } p { color: #399; background-color:#ffffff; padding: 20px; margin: 10px; } --> </style> <body> <p>BOX and PADDING<br> この領域はボックスといいます。テキストなどのコンテンツ内容を表示する領域です。このボックスと内容との余白をパディングといいます。</p> </body> </html>
解答
<!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>css15</title> <style type="text/css"> <!-- body{ background-color: #CCCCCC; } p { color: #65998D; background-color: #ffffff; padding: 30px; } --> </style> </head> <body> <p>BOX and PADDING<br> この領域はボックスといいます。テキストなどのコンテンツ内容を表示する領域です。このボックスと内容との余白をパディングといいます。</p> </body> </html>