-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathstyle-lab5.css
More file actions
93 lines (76 loc) · 1.47 KB
/
style-lab5.css
File metadata and controls
93 lines (76 loc) · 1.47 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/* CSS files add styling rules to your content */
body {
font-family: helvetica, arial, sans-serif;
margin: 2em;
}
h1 {
font-style: italic;
color: #373fff;
}
.container {
background: #f2f2f2;
padding: 20px;
margin:20px;
width:700px; /* change to fixed pixel value */
}
.pos-relative {
width: 150px;
height: 150px;
vertical-align: middle; /*remove this and see how it changes */
padding:5px;
display: inline-block;
width: 150px;
height: 150px;
text-align: center;
}
.left {
background: chartreuse;
color: magenta;
/*
position:absolute;
margin-top:20px;
margin-left:20px
*/
}
.right {
background: magenta;
color: chartreuse;
/*position:absolute;*/
}
.pos-absolute {
position: absolute;
text-align: center;
background: teal;
color: white;
width: 150px;
height: 150px;
/*pin to the top: */
bottom: 10px;
right: 10px;
}
.pos-fixed {
position: fixed;
text-align: center;
background: cyan;
color: white;
width: 150px;
height: 150px;
/*pin to the bottom: */
bottom: 10px;
right: 10px;
}
/* together with the container div, the image and caption can be side by side */
img{
width:150px;
height:150px;
display:inline-block;
vertical-align: top; /*try middle or bottom */
object-fit: cover; /*crops the picture to dimensions */
}
.caption{
position:relative;
display:inline-block;
width:70%; /* adjust this as the container width changes */
margin-left:20px;
margin-right:20px;
}