File tree Expand file tree Collapse file tree 2 files changed +73
-73
lines changed
docs/2-browser-apps/05-css-layout Expand file tree Collapse file tree 2 files changed +73
-73
lines changed Original file line number Diff line number Diff line change 33 background-color : # fff ;
44}
55
6- header {
7- background-color : # fff ;
8- border-bottom : 1px solid # eee ;
9- }
10-
11- .container {
12- display : flex;
13- justify-content : space-between;
14- align-items : center;
15- padding : 16px 24px ;
16- }
17-
18- # menu {
19- display : flex;
20- gap : 32px ;
21- }
22-
23- @media (max-width : 768px ) {
24- # hamburger {
25- display : flex;
26- }
27-
28- nav {
29- display : none;
30- }
31- }
32-
336header ul {
347 margin : 0 ;
358 padding : 0 ;
@@ -56,3 +29,30 @@ header ul {
5629 padding : 0 ;
5730 cursor : pointer;
5831}
32+
33+ header {
34+ background-color : # fff ;
35+ border-bottom : 1px solid # eee ;
36+ }
37+
38+ .container {
39+ display : flex;
40+ justify-content : space-between;
41+ align-items : center;
42+ padding : 16px 24px ;
43+ }
44+
45+ # menu {
46+ display : flex;
47+ gap : 32px ;
48+ }
49+
50+ @media (max-width : 768px ) {
51+ # hamburger {
52+ display : flex;
53+ }
54+
55+ nav {
56+ display : none;
57+ }
58+ }
Original file line number Diff line number Diff line change @@ -519,30 +519,6 @@ body {
519519 background-color : #fff ;
520520}
521521
522- header {
523- background-color : #fff ;
524- /* ここで適切な境界線を設定する */
525- }
526-
527- .container {
528- display : flex ;
529- /* ここで適切なレイアウトを設定する */
530- }
531-
532- #menu {
533- display : flex ;
534- /* ここで適切なレイアウトを設定する */
535- }
536-
537- @media (max-width : 768px ) {
538- #hamburger {
539- display : flex ;
540- }
541- /* ここで適切な設定を行う */
542- }
543-
544- /* 以下は変更する必要はありません。 */
545-
546522header ul {
547523 margin : 0 ;
548524 padding : 0 ;
@@ -569,47 +545,44 @@ header ul {
569545 padding : 0 ;
570546 cursor : pointer ; /* マウスカーソルをポインタにする */
571547}
572- ```
573-
574- :::tip
575548
576- `display`プロパティに`none`を指定すると、要素が表示されなくなります。
577-
578- :::
579-
580- <Answer>
581-
582- ```css title="style .css"
583- body {
584- margin : 0 ;
585- background-color : #fff ;
586- }
549+ /* ここから下を変更してください。 */
587550
588551header {
589552 background-color : #fff ;
590- border-bottom : 1 px solid #eee ;
553+ /* ここで適切な境界線を設定する */
591554}
592555
593556.container {
594557 display : flex ;
595- justify-content : space-between ;
596- align-items : center ;
597- padding : 16px 24px ;
558+ /* ここで適切なレイアウトを設定する */
598559}
599560
600561#menu {
601562 display : flex ;
602- gap : 32 px ;
563+ /* ここで適切なレイアウトを設定する */
603564}
604565
605566@media (max-width : 768px ) {
606567 #hamburger {
607568 display : flex ;
608569 }
570+ /* ここで適切な設定を行う */
571+ }
572+ ```
609573
610- nav {
611- display : none ;
612- }
574+ :::tip
575+
576+ `display`プロパティに`none`を指定すると、要素が表示されなくなります。
577+
578+ :::
579+
580+ <Answer>
581+
582+ ```css title="style .css"
583+ body {
584+ margin : 0 ;
585+ background-color : #fff ;
613586}
614587
615588header ul {
@@ -638,6 +611,33 @@ header ul {
638611 padding : 0 ;
639612 cursor : pointer ;
640613}
614+
615+ header {
616+ background-color : #fff ;
617+ border-bottom : 1px solid #eee ;
618+ }
619+
620+ .container {
621+ display : flex ;
622+ justify-content : space-between ;
623+ align-items : center ;
624+ padding : 16px 24px ;
625+ }
626+
627+ #menu {
628+ display : flex ;
629+ gap : 32px ;
630+ }
631+
632+ @media (max-width : 768px ) {
633+ #hamburger {
634+ display : flex ;
635+ }
636+
637+ nav {
638+ display : none ;
639+ }
640+ }
641641```
642642
643643<ViewSource url={import .meta .url } path="_samples/responsive-header " />
You can’t perform that action at this time.
0 commit comments