HTML1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>home0409</title> <link rel="stylesheet" type="text/css" href="home0409.css"> </head> <body> <div id="homeimg"> <img src="../../images/26.jpg" width="2048px"/> <button type="button" id="btnEnter"><a href="home0409_2.html">들어가기</a></button> </div> </body> </html> | cs |
HTML2
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 | <!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>home0409</title> <link rel="stylesheet" type="text/css" href="home0409.css"> </head> <body> <div class="container"> <header class="mainHeader"> <h1 class="header1"><a href="home0409_2.html">SGGP</a></h1> <div class="header2">All The Vinyls In The World</div> </header> <nav class="mainNav"> <ul> <li><a href="#">인기순위</a></li> <li><a href="#">제품목록</a></li> <li><a href="#">문의하기</a></li> </ul> </nav> <section class="content"> <h2>오늘 입고 된 바이닐</h2> <table> <tr> <td><p class="imgDetail"><img src="../../images/home0409_1.png" alt="히데유키 하시모토"></p></td> <td> <b><h3>Hideyuki Hashimoto / opus</h3></b> <p class="detail">2020년부터 2021년까지 디지털 발매된 싱글 컬렉션을 패키지화.<br/> 자택의 업라이트 피아노를 펠트로 프리페어드 후 녹음한 것으로, 계절을 둘러싼 일상의 기록이 담겨 있습니다. </p> </td> </tr> <tr> <td><p class="imgDetail"><img src="../../images/home0409_2.png" alt="아키라 코세무라"></p></td> <td> <p><b><h3>Akira Kosemura / 88Keys</h3></b></p> <p class="detail">2020년 아키라 코세무라의 스튜디오에서 작곡 및 녹음된 피아노 솔로곡들로 구성된 앨범입니다.</p> </td> </tr> </table> </section> <footer class="footer"> <p>109, Sajik-daero, Seowon-gu, Cheongju-si, Chungcheongbuk-do</p> <p>Copyrightⓒ. All rights reserved.</p> </footer> </div> </body> </html> | cs |
CSS
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 | /* home */ body { margin: 0px; padding: 0px; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 0.8em; background-attachment: fixed; } #homeimg { width: 2048px; margin: 0 auto; position: relative; } #btnEnter { background-color: #fff; opacity: 0.8; color: black; position: absolute; left: 974px; top: 444px; width: 100px; padding: 10px; cursor: pointer; border: 1px solid #ccc; border-radius: 5px; } #btnEnter a { text-decoration-line: inherit; color: black; } #btnEnter:hover { background-color: #ddd; } /* --------------------------0409_2----------------------------- */ .container { display: grid; grid-template-areas: 'header header' 'aside content' 'footer footer'; grid-template-rows: 150px 1fr 100px; grid-template-columns: 150px 1fr; padding: 50px; color: black; background-color: rgba(164, 182, 131, 0.712); } /* 헤더 */ .mainHeader { grid-area: header; margin-top: 0px; position: relative; background-color: #eee; } .mainHeader .header1 { float: left; text-align: center; font-size: 3em; margin-top: 40px; margin-left: 80px; } .mainHeader .header2 { float: left; font-size: 1em; position: absolute; bottom: 40px; left: 200px; color: seagreen; } .mainHeader .header1 a { text-decoration-line: none; letter-spacing: 1em; color: seagreen; } /* 네비게이션 바 */ .mainNav { grid-area: aside; float: left; background-color: rgb(142, 202, 142); } .mainNav ul li { float: left; width: 100px; height: 40px; font-size: 1em; padding: 10px 0px 10px 10px; list-style: none; } .mainNav a { text-decoration-line: none; color: black; display: block; font-weight: bolder; } .mainNav a:hover { color: #fff; } /* content */ .content { grid-area: content; padding: 20px; background-color: #eee; } .content h2 { text-align: center; font-size: 2em; color: darkgreen; margin: 0px 0px 70px 0px; } .content h3 { font-size: 1.5em; color: darkgreen; margin: 20px 0px 0px 0px; } .content img { float: left; } .content .detail { margin: 50px 0px 0px 0px; line-height: 2em; } table { vertical-align: middle; border-collapse: collapse; margin: 30px 0px 30px 0px; } td { text-align: left; padding: 5px; } /* footer */ .footer { float: left; text-align: center; grid-area: footer; background-color: black; color: #ddd; padding-top: 20px; } /* 태블릿 화면 설정 600~1023px */ @media screen and (min-width:600px) and (max-width:1023px) { .container { padding: 40px; grid-template-columns: 120px 1fr; } /* 헤더 */ .mainHeader { margin-top: 0px; } .mainHeader .header1 { font-size: 2.5em; } .mainHeader .header2 { font-size: 1em; bottom: 40px; left: 150px; } .mainHeader .header1 a { letter-spacing: 0.8em; } /* 네비게이션 바 */ .mainNav ul li { width: 80px; font-size: 1em; padding: 10px 5px 10px 0px; } /* content */ .content { padding: 15px; } .content h2 { font-size: 1.8em; margin: 0px 0px 50px 0px; } .content h3 { font-size: 1.2em; margin: 10px 0px 0px 0px; } .content img { width: 90%; } .content .detail { line-height: 2em; } td .imgDetail { text-align: center; padding: 5px; } } /* 모바일 (최대 599px) */ @media screen and (max-width:599px) { .container { grid-template-rows: 100px 1fr 80px; grid-template-columns: 100px 1fr; padding: 0px; } /* 헤더 */ .mainHeader { margin-top: 0px; } .mainHeader .header1 { text-align: center; font-size: 2em; margin-top: 20px; margin-left: 50px; } .mainHeader .header2 { font-size: 1em; bottom: 20px; left: 130px; } .mainHeader .header1 a { letter-spacing: 0.9em; } /* 네비게이션 바 */ .mainNav ul li { float: left; width: 80px; height: 40px; font-size: 1em; padding: 10px 0px 10px 0px; } /* content */ .content { padding: 10px; } .content h2 { text-align: center; font-size: 1.5em; margin: 0px 0px 50px 0px; } .content h3 { font-size: 1.2em; margin: 20px 0px 0px 0px; } .content img { width: 80%; } .content .detail { margin: 30px 0px 0px 0px; line-height: 2em; } /* footer */ .footer { padding-top: 0px; } } | cs |
PC화면
태블릿 화면
모바일화면
모바일 화면 크기 설정할때 aside 부분에서 ul li 글자가 가운데 정렬이 되지 않는데 어떻게 해결해야할지 모르겠습니다...
첫댓글 ul / ol 태그안의 글자만이 가운데로는 가지 않기에 해당 태그를 둘러싼 태그를 가운데 정렬해서 ul의 모든 항목이 가운데 정렬되도록 처리해 보세요.
잘 보았습니다.수고하셨습니다.