sample-blog/neocities-cyi1341sampleblog/style.css

116 lines
1.8 KiB
CSS

body {
margin: 0;
font-family: Arial, sans-serif;
background-image: url("http://placekitten.com/800/600");
background-size: cover;
}
.container {
max-width: 960px;
margin: 20px auto;
padding: 0 30px;
box-sizing: border-box;
display: flex;
flex-direction: row;
}
.top-left, .top-right {
position: absolute;
top: 0;
}
.top-left {
left: 0;
}
.top-right {
right: 0;
}
.dropdown:hover, .dropdown-content {
display: block;
}
.left {
flex: 1;
margin-right: 20px;
}
.right {
flex: 3;
margin-left: 20px;
}
section {
border: 1px solid #000000;
margin-bottom: 20px;
padding: 20px;
box-sizing: border-box;
background-color: #ffffff;
}
h2 {
margin: 0;
padding-bottom: 10px;
}
a {
display: block;
text-decoration: none;
color: #333;
padding-bottom: 5px;
}
img {
max-width: 100%;
}
@media (max-width: 767px) {
.container {
flex-direction: column;
}
.left, .right {
flex: none;
width: 100%;
margin-right: 0;
margin-left: 0;
}
.left {
margin-bottom: 20px;
}
}
.header {
display: flex;
justify-content: space-between;
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f1f1f1;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
z-index: 1;
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
input[type="checkbox"]:checked ~ .dropdown-content {
display: block;
}
.dropdown-btn {
background-color: #4CAF50;
color: white;
padding: 16px;
font-size: 16px;
border: none;
cursor: pointer;
}
.dropdown-btn:hover {
background-color: #3e8e41;
}
@media (min-width: 769px) {
.dropdown {
display: none;
}
}
@media (max-width: 768px) {
.left.desktop-only {
display: none;
}
}