TA的每日心情 | 开心 2018-8-8 03:13 |
|---|
签到天数: 1 天 [LV.1]初来乍到
|
本帖最后由 喬治兄 于 2021-1-22 23:33 编辑
2 ?$ S: {. J* _4 [1 C& D2 F; X# _2 Z# `9 F" ~1 _7 i H
請賜教 css & html
" X3 F$ R. e& |$ C* I z
2 k r. i' U9 p% ~; ohttps://www.w3schools.com/code/tryit.asp?filename=GIH4P74ZQBJ7
" x6 ~# Q. |% l: k! m% M) ?& c$ f; W' [. e
請賜教想要當按兩邊的 zone 1~zone 8 區域時是否能再返回到最上面的導航那列( i. f; w6 z: r$ j
; P, n5 }3 h' U9 H2 `8 W
<a href="#1">zone 1</a> , <a href="#2">zone 2</a> , <a href="#3">zone 3</a> , <a href="#4">zone 4</a> , 6 }9 d5 j# I6 r& X1 E+ }4 ~6 Y
<a href="#5">zone 5</a> , <a href="#6">zone 6</a> , <a href="#7">zone 7</a> , <a href="#8">zone 8</a>* q) I! W7 K. ]. f* _" h9 Q/ S9 l
..........這個區域且配合 hightlight . r3 }& B6 R: t$ [# j( B
4 p+ G3 J$ X7 E* G
Thanks a lot
3 h) t r- G2 z o2 C2 @- l% e
, f2 W l, p4 i" a" Q t( e" L9 b8 f: g
| X5 ]* s9 v9 K/ K* \1 K& z+ O) P
9 |- p2 J9 U. i/ e3 u$ l6 u
- Q: O/ Z* N* P- |6 O8 B( ^. K4 X
<!DOCTYPE html>0 ~) @+ k" @! \3 g9 |- h/ R
<html>5 E# O. i4 F% |8 U9 k$ |
<head>+ h* A# a9 j, Y9 M; x @
<style>
8 ~ q& @3 A$ c' {! |#main {
) n1 C7 F8 v; ? n$ r5 y. k width: max-width;0 U8 B, |4 Z U; M z- p
height: 100vw;5 Z3 ^2 ^- q( \/ I) s
border: 1px solid #c3c3c3; K" s# U' H2 k7 |
display: flex;
# I4 `, P: w2 m6 D flex-wrap: nowrap;
6 u; |9 Z& M$ J+ r, B - n# G- M: j7 f3 W- L* r a. n
}# i, M/ b# O! g" w
3 j# h# T+ ^: W) U% s& t2 D" W
#main div {
4 M, c- y0 k+ x: C center4 u1 q, _5 f- s$ n6 g/ S8 d8 K
height: 100vw;5 K% z0 l0 p% g0 s) y w
text-align: center;0 c# ? w0 k- [6 x" ]2 `0 I
flex-grow: 1;( {: \8 P8 ^& T4 J1 i3 n S$ q
flex-shrink: 1;
' e. r6 P, |5 E3 ^) C}
. L, `* Y5 z2 t* z6 H7 B.flex-container {
' o. J3 s7 ~3 ~1 i" V display: -webkit-flex;
0 H* @* h( v9 D6 z- D. q) O# @2 v display: flex;
- _7 x( I3 N' a4 u- u, c -webkit-flex-direction: column;9 }2 f* |6 _# I c% b- {
flex-direction: column;
0 {0 U! I2 ^& t) ?: Q5 b3 p8 s width: max-width;) I, @" D, u' s
height: 100vw;& p6 @. r {5 r. {9 O( A
background-color: lightgrey;6 Q- c* g3 Y/ N$ s
' k/ O0 J# Z& M- l! L& l. \: D
}/ o6 g/ V4 R, ?+ K2 _- r0 @
+ k$ ]# i# O. p: i.flex-item {8 D+ \# F0 F1 E4 T! H' B' s- ^
width: 1.5vw;" {* B+ M& M) q% n- c5 m5 O. t
height: 25vw;: l& `% ` Q3 M7 ?. R3 Z; {, m& v" ?
text-align: center;0 E. H: }# d1 `4 A9 f8 ?
line-height: 25vw;* g4 l' ]! @/ j" b! L* D5 \$ q
font-size: 1.5vw;
& x) I/ W7 \. H% J: _8 e background-color: white;
1 H* Q5 _ K4 ^2 |/ m }1 ]7 X2 J, `8 \' P
3 M! _; k' O" h/ M2 F1 f/ {$ m1 g l( _* @/ r3 W/ c
:target {
/ \% {+ |: E0 i3 F/ \' g0 ^ border: .5px solid #D4D4D4;& l; C% f2 G' W6 h: z9 P* |% \+ _
border-color: black;
1 [ m. v3 X0 c5 |: P- p background-color: yellow;
8 |5 a! q; s0 O* o+ o/ g}
/ a4 E$ c c) O& Q2 e</style>" O/ g' E" u0 v+ c+ D8 P' Z W" @
</head>$ {$ [( e# c; u% W. @; i
<body>- }& p: |2 R0 m9 V9 d4 U
<a href="#1">zone 1</a> , <a href="#2">zone 2</a> , <a href="#3">zone 3</a> , <a href="#4">zone 4</a> , 3 }8 }% S" \/ { ~1 D
<a href="#5">zone 5</a> , <a href="#6">zone 6</a> , <a href="#7">zone 7</a> , <a href="#8">zone 8</a>2 b% O0 ]* x) q: \3 [
<div id="main">
: g( y3 G( S* I7 b2 x) o/ u8 R <div style="background-color:lightgrey;width:1.5w;"><div class="flex-container">8 l( d& |8 b2 j R( T" s1 r% Q
<div id="1" class="flex-item">1</div># Q2 U0 b4 |; Y9 k( u
<div id="2" class="flex-item">2</div>; ?% R8 k* U8 L3 j9 x
<div id="3" class="flex-item">3</div>( h$ S* N2 k. x/ i
<div id="4" class="flex-item">4</div>
; \; w& x5 C# |2 X5 N</div></div>
. P3 [' b7 @) }7 Z <div style="background-color:lightblue;width:93vw;">B</div>
" _; M( q7 C9 O" i6 i# q <div style="background-color:lightgrey;width:1.5vw;"><div class="flex-container">/ I- q1 s. `4 K5 q0 d; y
<div id="5" class="flex-item">5</div>, w6 _, q; v/ L4 j( H
<div id="6" class="flex-item">6</div>/ o+ F: _" Q0 P: S0 B8 v0 Z
<div id="7" class="flex-item">7</div>
5 j* c- K h: r* ` <div id="8" class="flex-item">8</div>
* t+ q1 q5 `: z7 C, {3 Z' q</div></div>6 W r3 u; @$ |$ Z* G0 q; j
</div>7 W! S I% F# h G$ C
! E1 i I; h8 B6 j, t) W% M- W9 {; o" {2 x# N# X: I
</body>& q+ Z$ k+ Z8 R5 l* x
</html>) [+ A2 A0 R( d+ p- T
|
|