-
Notifications
You must be signed in to change notification settings - Fork 14
/
horizontal-formatting-setting-explicit-width.html
executable file
·37 lines (33 loc) · 1.36 KB
/
horizontal-formatting-setting-explicit-width.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>
<title>Setting an explicit inline size</title>
<link rel="stylesheet" type="text/css" href="base.css">
<style type="text/css">
footer {width: 500px; border: 1px solid gray; border-bottom: 0; margin-bottom: 2px; text-align: center; height: 10px; clear: both;}
footer b {font: italic 0.9em sans-serif; background: white; padding: 0 0.33em; line-height: 1px; vertical-align: top;}
div footer {position: absolute; bottom: 0; left: 0; border-width: 0 1px; height: auto; box-sizine: border-box;
background: linear-gradient(transparent, transparent 49%, gray 49%, gray 52%, transparent 52%, transparent);
opacity: 0.67;}
div .lm {width: 100px; left: -1px;}
div .wd {width: 300px; left: 99px;}
div .rm {width: 100px; left: 399px;}
div footer b {vertical-align: baseline;}
div {float: left; border: 1px dotted gray; position: relative;}
div {width: 500px;}
p {background: #CCC; text-align: center; margin-top: 1.5em; margin-bottom: 1.5em;}
p {width: 300px; margin-left: auto; margin-right: auto;}
/* each margin is 100 pixels wide, because (500-300)/2 = 100 */
</style>
</head>
<body>
<footer><b>500px</b></footer>
<div>
<p>a paragraph</p>
<footer class="lm"><b>100px</b></footer>
<footer class="wd"><b>300px</b></footer>
<footer class="rm"><b>100px</b></footer>
</div>
</body>
</html>