CSS課題の続き
課題12の修正
<!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" 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>【CSSの練習12】</title> <style type="text/css"> * { margin: 0; padding: 0; } #nav { margin: 10px 0 0 30px; } ul { list-style-type:disc; color:#ff0000; } li a:link,li a:visited{ text-decoration: none; color: #000; } li a:hover{ color: #ff6600; text-decoration: underline; } </style> </head> <body> <div id="nav"> <ul> <li><a href="#">メニューのリンク1</a></li> <li><a href="#">メニューのリンク2</a></li> <li><a href="#">メニューのリンク3</a></li> <li><a href="#">メニューのリンク4</a></li> <li><a href="#">メニューのリンク5</a></li> </ul> </div> </body> </html>
課題13から15の画像なしバージョンのソース
<!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" 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>【CSS13】</title> <style type="text/css"> * { margin: 0; padding:0; } #nav { font-size: 1em; font-weight: bold; width: 150px; height: auto; margin: 50px 0 0 50px; } #nav ul { list-style-type: none; border-top: 1px solid #000; background-color: #ccc; } #nav li a { width: auto; height: auto; padding: 10px; display: block; border-bottom: 1px solid #000; } #nav li a:link,#nav li a:visited { color: #000; text-decoration:none; } #nav li a:hover { color: orange; } </style> </head> <body> <div id="nav"> <ul> <li><a href="#">メニューのリンク1</a></li> <li><a href="#">メニューのリンク2</a></li> <li><a href="#">メニューのリンク3</a></li> <li><a href="#">メニューのリンク4</a></li> <li><a href="#">メニューのリンク5</a></li> </ul> </div> </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" 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>【CSS14】</title> <style type="text/css"> * { margin: 0; padding:0; } #nav { font-size: 1em; font-weight: bold; width: 150px; height: auto; margin: 50px 0 0 50px; } #nav ul { list-style-type: none; background-color: green; } #nav li a { color: white; width: auto; height: auto; padding: 10px; display: block; border-bottom: 1px solid #fff; } #nav li a:link,#nav li a:visited { text-decoration:none; } #nav li a:hover { background-color: orange; } </style> </head> <body> <div id="nav"> <ul> <li><a href="#">メニューのリンク1</a></li> <li><a href="#">メニューのリンク2</a></li> <li><a href="#">メニューのリンク3</a></li> <li><a href="#">メニューのリンク4</a></li> <li><a href="#">メニューのリンク5</a></li> </ul> </div> </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" 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>【CSS15】</title> <style type="text/css"> <!-- * { margin: 0; padding:0; } #nav { font-size: 1em; font-weight: bold; width: 200px; height: auto; margin: 50px 0 0 50px; border-top: 1px solid #ccc; border-right: 1px solid #ccc; border-left: 1px solid #ccc; } #nav ul { list-style-type: none; background-color: white; } #nav li a { color: #000; width: auto; height: auto; padding: 10px; display: block; border-bottom: 1px solid #ccc; } #nav li a:link { text-decoration:none; border-left: 15px solid #D5EAEF; } #nav li a:visited { border-left: 15px solid #0176AB; } #nav li a:hover { border-left: 15px solid skyblue; } </style> </head> <body> <div id="nav"> <ul> <li><a href="##">メニューのリンク1</a></li> <li><a href="#">メニューのリンク2</a></li> <li><a href="#">メニューのリンク3</a></li> <li><a href="#">メニューのリンク4</a></li> <li><a href="#">メニューのリンク5</a></li> </ul> </div> </body> </html>