CSS Flex özelliği kullanarak hazırladığım bu basit çalışma ile bir web sayfası tasarımı yapılırken dikkat edilecek noktaları mobil görünümü ile birlikte tasarlamaya gayret gösterdim.
Burada hazırlanan çalışma CSS flex özelliklerini iyi bir detaylı bir şekilde kullanmayı içeren iyi bir eğitim materyali olmasını hedefledim.
Hazırlanan HTML Sayfasını görüntüsü:

HTML Kodu:
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 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
<!DOCTYPE html> <html lang="tr"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Sitem</title> <link rel="stylesheet" href="stil.css"> </head> <body> <header> <nav> <div class="logo"> <h1>Benim Sitem</h1> </div> <ul> <li><a href="#">sayfa</a></li> <li><a href="#">sayfa</a></li> <li><a href="#">sayfa</a></li> <li><a href="#">sayfa</a></li> <li><a href="#">sayfa</a></li> </ul> <i class="bi bi-list" id="menu"></i> </nav> <div class="header-icerik"> <div class="header-sol"> <h1>Bültene Katıl</h1> <p>Merak etmeyin <span>spam mesaj</span> atmayacağız. Günde en fazla 3-5 mesaj atarız :)</p> <form action=""> <input type="text" name="" id="" placeholder="ad soyad"> <input type="tel" name="" id="" placeholder="5xx xxx xx xx"> <input type="submit" value="Bültene Katıl"> </form> </div> <div class="header-sag"> </div> </div> </header> <section class="galeri bg-yesil"> <div class="satir"> <h1>Galeri</h1> </div> <div class="satir"> <div class="kart"> <img src="https://picsum.photos/300/300" alt=""> <p> <a href="#"><i class="bi bi-share-fill"></i></a> <a href="#"><i class="bi bi-facebook"></i></a> <a href="#"><i class="bi bi-whatsapp"></i></a> <a href="#"><i class="bi bi-instagram"></i></a> </p> </div> <div class="kart"> <img src="https://picsum.photos/300/300" alt=""> <p> <a href="#"><i class="bi bi-share-fill"></i></a> <a href="#"><i class="bi bi-facebook"></i></a> <a href="#"><i class="bi bi-whatsapp"></i></a> <a href="#"><i class="bi bi-instagram"></i></a> </p> </div> <div class="kart"> <img src="https://picsum.photos/300/300" alt=""> <p> <a href="#"><i class="bi bi-share-fill"></i></a> <a href="#"><i class="bi bi-facebook"></i></a> <a href="#"><i class="bi bi-whatsapp"></i></a> <a href="#"><i class="bi bi-instagram"></i></a> </p> </div> <div class="kart"> <img src="https://picsum.photos/300/300" alt=""> <p> <a href="#"><i class="bi bi-share-fill"></i></a> <a href="#"><i class="bi bi-facebook"></i></a> <a href="#"><i class="bi bi-whatsapp"></i></a> <a href="#"><i class="bi bi-instagram"></i></a> </p> </div> <div class="kart"> <img src="https://picsum.photos/300/300" alt=""> <p> <a href="#"><i class="bi bi-share-fill"></i></a> <a href="#"><i class="bi bi-facebook"></i></a> <a href="#"><i class="bi bi-whatsapp"></i></a> <a href="#"><i class="bi bi-instagram"></i></a> </p> </div> <div class="kart"> <img src="https://picsum.photos/300/300" alt=""> <p> <a href="#"><i class="bi bi-share-fill"></i></a> <a href="#"><i class="bi bi-facebook"></i></a> <a href="#"><i class="bi bi-whatsapp"></i></a> <a href="#"><i class="bi bi-instagram"></i></a> </p> </div> </div> </section> <section class="bolum2"> <div class="satir"> <h1>Değerlendirme</h1> </div> <div class="satir"> <div class="oylar"> <img src="gorsel/owl.png" alt="Nazlı Kaya"> <p class="kisi">Nazlı Kaya</p> <p class="oy"> <i class="bi bi-star-fill"></i> <i class="bi bi-star-fill"></i> <i class="bi bi-star-fill"></i> <i class="bi bi-star-fill"></i> <i class="bi bi-star"></i> </p> </div> <div class="oylar"> <img src="gorsel/owl.png" alt="Nazlı Kaya"> <p class="kisi">Nazlı Kaya</p> <p class="oy"> <i class="bi bi-star-fill"></i> <i class="bi bi-star-fill"></i> <i class="bi bi-star-fill"></i> <i class="bi bi-star-fill"></i> <i class="bi bi-star"></i> </p> </div> <div class="oylar"> <img src="gorsel/owl.png" alt="Nazlı Kaya"> <p class="kisi">Nazlı Kaya</p> <p class="oy"> <i class="bi bi-star-fill"></i> <i class="bi bi-star-fill"></i> <i class="bi bi-star-fill"></i> <i class="bi bi-star-fill"></i> <i class="bi bi-star"></i> </p> </div> </div> </section> <footer> <div class="satir"> <h1>Sosyal Medyada Bizi Takip Edin</h1> <div class="sosyal"> <a href="#"><i class="bi bi-youtube"></i></a> <a href="#"><i class="bi bi-pinterest"></i></a> <a href="#"><i class="bi bi-twitter"></i></a> <a href="#"><i class="bi bi-reddit"></i></a> </div> </div> </footer> </body> </html> |
CSS Kodu:
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 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
/*google font*/ @import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,200;0,400;0,600;1,800&display=swap'); /*bootstrap icons*/ @import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css"); /*genel*/ *{ box-sizing: border-box; margin:0; padding:0; } html{ font-size:62.5%; } body{ font-family: 'Nunito Sans', sans-serif; } ul{ list-style: none; } section{ padding:100px 0; } img{ width: 100%; height: auto; } .satir{ display: flex; width: 80%; margin:auto; } .bg-yesil{ background-color: #8ebd57; } /*SITE*/ /*header*/ header{ min-height: 80vh;/*kaldır*/ background: url(gorsel/bg-cimen.png) repeat-x bottom, url(gorsel/bulut-2.png), #1DABB8; } nav{ display: flex; justify-content: space-between; align-items: center; background-color: #1DABB8; padding:2% 10%; } .logo h1{ color:#fff; font-size:3.2rem; } nav ul li{ display: inline-block; } nav ul li a{ display: block; border:dashed 3px #fff; padding:5px 10px; margin:0 10px; font-size:1.8rem; color:#fff; text-decoration: none; } nav ul li a:hover{ border-color:#D8335B; color:#D8335B; } #menu{ font-size:3.2rem; color:#fff; display: none; } /*header-icerik*/ .header-icerik{ display: flex; width: 80%; margin:50px auto 0 auto; } .header-sol, .header-sag{ flex-basis: 50%; } .header-sol{ background-color: #25373D; padding:40px; } .header-sol h1{ color:#fff; font-size:4.8rem; font-weight: 800; } .header-sol p{ color:#fff; font-size:1.8rem; line-height: 150%; font-weight: 200; margin-bottom:20px; } .header-sol p span{ background-color: #FEC606; padding:5px 10px; color:#25373D; } header input{ display: block; width: 100%; padding:10px 20px; margin-bottom:10px; } header input[type=text], header input[type=tel]{ border:solid 3px #FEC606; outline:none; } header input[type=text]:focus, header input[type=tel]:focus{ background-color: #FEC606; } header input[type=text]::placeholder, header input[type=tel]::placeholder{ color:#FEC606; } header input[type=submit]{ background-color: #FEC606; color:#25373D; border:none; text-transform: uppercase; cursor: pointer; } header input[type=submit]:hover{ outline:solid 3px #FEC606; background-color: #25373D; color:#FEC606; } .header-sag{ background: url(gorsel/hot-air-balloon.png); background-repeat: no-repeat; background-size: 40%; background-position: center center; } .galeri .satir{ flex-wrap: wrap; width: 70%; } .galeri h1, .bolum2 h1{ font-size:4.8rem; color:#fff; flex:content; text-align: center; } .galeri .kart{ padding:20px; background-color: #25373D; flex-basis: 30%; margin: calc(10%/6); } .galeri p{ text-align: center; margin-top:20px; } .galeri p a{ color:#fff; padding:0 10px; font-size:1.8rem; } .galeri p a:hover{ color:#FEC606; } .bolum2{ background: url(gorsel/cimen-2.png) repeat-x, url(gorsel/toprak1.jpg); } .bolum2 .satir{ justify-content: center; } .oylar{ display: flex; flex-direction: column; justify-content: center; align-items: center; background-color: #8ebd57; margin:10px; padding:30px; width: 200px; height: 200px; border-radius: 50%; } .oylar img{ width: 70%; } .oylar p{ font-size:1.4rem; color:#fff; font-style: italic; } .oylar .oy{ color:#25373D; } footer{ background-color: #25373D; padding:100px 0; border-top:2px solid #1d282c; } footer .satir{ background-color: #1DABB8; flex-direction: column; align-items: center; border-radius: 4px; box-shadow: 0 0 20px #22ccdb; } footer h1{ background: #fff; padding: 0 20px; color:#1d282c; height: 50px; line-height: 50px; border-radius: 25px; margin-top:-25px; box-shadow: 1px 1px 2px #1d282c; } footer .sosyal{ margin:50px 0; } footer a{ display: inline-block; color:#fff; font-size:2.4rem; margin:0 20px; transition: .2s; } footer a:hover{ transform: rotate(360deg); color:#FEC606; } @media only screen and (max-width:768px){ #menu{ position:absolute; display: block; top:5%; right: 5%; } nav{ position: relative; flex-direction: column; align-items: stretch; } nav ul{ margin-top:20px; background-color: #25373D; border-radius: 4px; } nav ul li{ display: block; padding:5px 10px; } nav ul li a{ border:none; } .header-sol{ flex-basis: 100%; } .header-sag{ display: none; } .galeri .kart{ flex-basis: 45%; margin: calc(10%/4); } } |