Modify the following HTML and CSS code to create some/all of the appearances on the next slides.
<div id="a">A</div> <div id="b">B</div> <div id="c"> Lorem ipsum dolor sit amet, ... </div> |
#a, #b { width: 100px; height: 100px; font: 30pt bold Helvetica, Arial, sans-serif; line-height: 100px; text-align: center; } #a { background-color: lightblue; } #b { background-color: pink; } #c { background-color: lightgray; } |
1.
#a { float: left; } #b { float: right; } |
2.
#a { float: left; } #b { float: right; clear: left; } |
3.
#a { float: left; } #b { float: right; clear: left; } #c { clear: left; text-align: right; } |
4.
#a { float: left; } #b { float: right; clear: left; } #c { text-align: right; width: 100px; margin-left: auto; margin-right: auto; } |
5.
#a { float: right; } #b { float: left; } #c { float: left; text-align: center; width: 100px; } |
6.
#a { float: right; } #b { position: absolute; top: 50px; right: 100px; } #c { clear: right; text-align: center; margin-right: 100px; } |
7.
#a, #b { float: left; } #c { margin-left: 200px; } |
8.
#a { float: left; } |
9.
Must modify the HTML before adding CSS:
<div id="d"> <div id="a">A</div> <div id="b">B</div> </div> #a, #b { float: left; } #c { margin-top: 100px; } #d { background-color: lightgreen; height: 100px; } |