--- title: 筆記(四) 導覽列&文章錨點設置 tag: html --- # 學習筆記(四) 導覽列&文章錨點設置 ###### tags: `html` ## 關於文章錨點 有時候在網頁最上方的nav,他們做超連結會導向頁面的某個區塊。 ## 作法 在指定區塊上`<div></div>`設定`id` ```html! <div id="test01"> <p> this is test. </p> </div> ``` 然後是超連結做導向,`<a></a>` ```htm! <a href="#test01">此連結導至id為test01的區塊</a> ``` ## 遇上置頂navbar問題 ```css! :target:before { content: ""; display: block; padding-top: 72.39px; margin-top: -72.39px; } ``` <small>完成於2023/08/30</small>
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up