Make a same-page anchor link in Phoenix Code Community
22 seconds · On-screen instructions
The café-hours practice menu is open to index.html in Phoenix Code. The file list is collapsed to give the preview more space. The recording starts with the code editor and Live Preview side by side.
Follow the Community steps and copy the HTML
Read the video’s on-screen instructions
- Open the mode menu and choose Highlight Mode.
- In the link, select href="#" in the editor.
- Replace it with href="#opening-hours".
- Scroll the preview. Click the green Opening hours heading.
- Select just the opening h2 tag in the editor.
- Add id="opening-hours" to the opening tag.
- Save the file. Choose Preview Mode.
- Scroll back to the top and click Opening hours.
- Check the green heading and both sets of hours.