Difference between revisions of "Team:Carnegie Mellon/CSS"
Line 4: | Line 4: | ||
<head> | <head> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | <style src = "" type = "text/css"> | |
− | + | body { | |
− | + | padding: 50px; | |
− | }); | + | } |
− | }); | + | ul { |
+ | border: 1px solid #444; | ||
+ | display: inline-block; | ||
+ | height: 301px; | ||
+ | position: relative; | ||
+ | width: 600px; | ||
+ | } | ||
+ | li { | ||
+ | font: bold 16px/100px sans-serif; | ||
+ | height: 100px; | ||
+ | } | ||
+ | a { | ||
+ | border-right: 1px solid #444; | ||
+ | border-top: 1px solid #444; | ||
+ | color: red; | ||
+ | display: block; | ||
+ | text-align: center; | ||
+ | text-decoration: none; | ||
+ | width: 99px; | ||
+ | } | ||
+ | li:first-child a { | ||
+ | border-top: none; | ||
+ | } | ||
+ | li:nth-child(2) a { | ||
+ | color: blue; | ||
+ | } | ||
+ | li:nth-child(3) a { | ||
+ | color: green; | ||
+ | } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | a:hover + .about1 { | |
+ | display: inline-block; | ||
+ | background: red; | ||
+ | color: #fff; | ||
+ | margin-left: 100px; | ||
+ | margin-top: -100px; | ||
+ | position: absolute; | ||
+ | } | ||
− | + | .about1 { | |
− | . | + | display: none; |
− | + | height: 301px; | |
+ | width: 500px; | ||
} | } | ||
+ | |||
+ | li:nth-child(2) a:hover { | ||
+ | background: blue; | ||
+ | color: #fff; | ||
+ | } | ||
+ | |||
+ | a:hover + .about2 { | ||
+ | display: inline-block; | ||
+ | background: blue; | ||
+ | color: #fff; | ||
+ | margin-left: 100px; | ||
+ | margin-top: -200px; | ||
+ | position: absolute; | ||
+ | } | ||
+ | |||
+ | .about2 { | ||
+ | display: none; | ||
+ | height: 301px; | ||
+ | width: 500px; | ||
+ | } | ||
+ | |||
+ | |||
+ | li:nth-child(3) a:hover { | ||
+ | background: green; | ||
+ | color: #fff; | ||
+ | } | ||
+ | |||
+ | a:hover + .about3 { | ||
+ | display: inline-block; | ||
+ | background: green; | ||
+ | color: #fff; | ||
+ | margin-left: 100px; | ||
+ | margin-top: -300px; | ||
+ | position: absolute; | ||
+ | } | ||
+ | |||
+ | .about3 { | ||
+ | display: none; | ||
+ | height: 301px; | ||
+ | width: 500px; | ||
+ | } | ||
+ | |||
Line 37: | Line 103: | ||
<body> | <body> | ||
− | < | + | <ul> |
− | < | + | <li> |
− | + | <a href="#">Item 1</a> | |
− | + | <div class = "about1">djfdlkjfdlkjd</div> | |
− | < | + | </li> |
− | + | <li> | |
− | + | <a href="#">Item 2</a> | |
− | + | <div class = "about2">djfdlkjfdlkjd</div> | |
− | + | </li> | |
− | < | + | <li> |
− | + | <a href="#">Item 3</a> | |
− | + | <div class = "about3">;dlkjfd;aljkf;aljdf;alsd</div> | |
− | </ | + | </li> |
− | + | </ul> | |
− | + | ||
− | + | ||
</body> | </body> | ||
</html> | </html> |
Revision as of 13:55, 29 July 2015