Ok, I have tried several times, but can't for the life of me figure it out. What is the XHTML code for an advertisement banner?

Dani AI

Generated

Brief expert summary tied to the thread: asked for XHTML for an ad banner, asked whether it would be an image or Flash, and suggested using an image and warned that motion can be intrusive. Below is a small, practical XHTML pattern and a few up-to-date best-practice notes to fill gaps left in the replies.

Minimal, valid XHTML clickable banner:

<a href="https://advertiser.example.com">
  <img src="banner.jpg" alt="Product name — short description" width="728" height="90" />
</a>

Notes: wrap the image with an anchor so clicks are tracked. The img tag is self-closed (required in XHTML). Include concise alt text for accessibility and numeric width/height to reserve layout space and reduce layout shift (see the W3C XHTML rules). For Strict XHTML, the target attribute is discouraged by the spec; use it only if the DTD allows it or handle new-window behavior via script.

Responsive and user-friendly adjustments:

.ad-banner img { max-width: 100%; height: auto; display: block; }

Serve appropriately sized files (desktop vs mobile), optimize formats (WebP or compressed PNG/JPG for static; animated WebP/APNG for motion). Honor reduced-motion preferences and avoid autoplay audio — this addresses 's concern about intrusive motion. See MDN for img usage and responsive behavior.

Other practical points: Flash is obsolete and unsupported (see Adobe Flash Player EOL). For third-party or script-heavy creatives, isolate content in an iframe to limit layout and security impact. Respect advertiser tracking and privacy rules (use server-side click redirects or the network's tracking pixel as required).

Recommended Answers

All 4 Replies

Is the banner an image or Flash?

Well, I don't know diddly squat about flash lol, so I was thinking of just using an image. However flash would be quite cool :)

nothing?

I would suggest that you just display the image. That's what most advertising banners are.

Some of them are motion picture images (which I don't like, because they steal control, preventing me from navigating quickly until they stop moving). The motion is contained inside the .gif or .flv file itself. If the file contains motion, it will move when displayed without further coding from you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.