Make a link.
Give the link a target attribute
<a href=””>Example Link</a>
Make an element with an id of your choice. Ours will be “example-id“. This will be used with the link for its target.
<p id=”example-id”>Example Text</p>
Give the link the id you put in the text inside the href attribute. Remember your hashtag (#)!
<a href=”#example-id”>Example Link</a>
Step 5 (optional).
You can make your link to go to a new page by adding “target=”_blank”” into the link.
<a href=”#example-id” target=”_blank”>Example Link</a>
The speech marks (“”) are the wrong speech marks. You will have to rewrite the speech marks in your code editor e.g. WordPress Custom HTML.
There can never be multiple same ids in one HTML file. There can only be one id in each element. Ids cannot have any special characters except underline (_) and hyphen (-).
There can be multiple same classes in one HTML file and elements can have multiple classes separated by spaces. Classes cannot have any special characters except underline (_) and hyphen (-).
You can preview your code in WordPress by making a post, then adding a block, and then choosing “Custom HTML”. Then you can write your code there and then click “Preview” to see what your code does.