Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 85 additions & 1 deletion css/style.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,88 @@
body {

* {
box-sizing: border-box;
}

body{
background-color: #dadada;
font-size: 10px;
width: 100%;
background-color: white;
margin: 0 auto;
}


#baku {
background-image: url("../images/baku.jpg");
}

#london {
background-image: url("../images/london.png");
}

#madrid {
background-image: url("../images/madrid.jpg");
}

#rome {
background-image: url("../images/rome.jpg");
}

.preview {
background-size: 420px 340px;
background-repeat: no-repeat;
background-position: center;
position: relative;
z-index: 1;
padding: 50px 50px;
object-fit: cover;
object-position: 30%;
width: 100%;
height: 280px;
margin: 10px auto;
}

h1 {
font-family: 'Roboto', sans-serif;
text-transform: uppercase;
text-align: center;
padding: 20px 20px;
}

.preview h1 {
text-transform: capitalize;
text-align: left;
position: absolute;
top: 10%;
left: 10%;
z-index: 1;
}

.container {
background-color: lightgrey;
width: 100%;
height: 100%;
}

@media only screen and (min-width: 575px) {
#baku, #london, #madrid, #rome {
margin: 1%;
width: 98%;
display: inline-block;
}

}

@media only screen and (min-width: 760px) {
#baku, #london, #madrid, #rome {
width: 47%;
}


}

@media only screen and (min-width: 1200px) {
#baku, #london, #madrid, #rome {
width: 22%;
}
}
10 changes: 6 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,24 @@
<head>
<meta charset="utf-8">
<title>css exercise four</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<section class="container">
<h1>Modern luxury <span class="emphasis">travel</span></h1>
<div class="preview baku">
<div class="preview" id="baku">
<h1>Baku</h1>
</div>
<div class="preview london">
<div class="preview" id="london">
<h1>London</h1>
</div>
<div class="preview madrid">
<div class="preview" id="madrid">
<h1>Madrid</h1>
</div>
<div class="preview rome">
<div class="preview" id="rome">
<h1>Rome</h1>
</div>
</section>
Expand Down