ID and Anchors in HTML

The id attribute uniquely identifies an element on a page. IDs can be used to link to specific parts of a page or as a hook for styling with CSS and interacting with JavaScript.

Let's see how anchor tags can help us navigate through different sections of a long article. We'll use an example article about platypuses (written by my good friend, Mr. GPT) and structure it into four sections: General Information, Habitat, Predators, and Cool Platypus Features.

Quick Navigation

Use the links below to jump to different sections:















General Information

The platypus is one of the most unusual creatures in the animal kingdom. It is a semi-aquatic mammal that is native to Australia. While it may look like a mix between a beaver and a duck, the platypus is in a family all by itself. In fact, it is one of the only five existing species of monotremes — mammals that lay eggs instead of giving birth to live young.

With its webbed feet, bill, and beaver-like tail, the platypus is adapted for life both in and out of the water. It feeds on insects and small aquatic creatures, which it hunts using its unique ability to sense electrical fields.















Habitat

Platypuses are found in freshwater environments such as rivers, streams, and lakes across eastern Australia and Tasmania. They prefer slow-moving waters with plenty of overhanging vegetation and debris that provide shelter and protection. They dig burrows into the riverbanks, where they rest and lay their eggs.

The ideal platypus habitat has both water for foraging and secluded areas for nesting. These habitats are critical for their survival, as changes in water levels or pollution can have a significant impact on their populations.
















Predators

While the platypus does not have many natural predators, it is still vulnerable to certain threats. Birds of prey such as hawks and eagles may target young or smaller platypuses. Introduced species like foxes and feral cats can also pose a danger, particularly to nesting females and eggs.

Human activities such as habitat destruction, water pollution, and climate change also present significant threats to platypus populations. Conservation efforts focus on preserving their habitats and minimizing human impact.















Cool Platypus Features

1. Electroreception

One of the most remarkable features of the platypus is its ability to sense electrical fields in the water. This adaptation, called electroreception, helps the platypus detect the movements of its prey even with its eyes closed. The electroreceptors are located in the skin of the platypus's bill, which it uses to scan the riverbed for food.

2. Venomous Spur

Male platypuses have a venomous spur on their hind legs, which they use for defense and possibly in mating battles with other males. The venom can cause severe pain in humans and is potent enough to immobilize smaller animals.

Back to General Information | Back to Habitat | Back to Predators | Back to Cool Features

Next: Images Previous: Links and Anchors