Prev | Current Page 269 | Next

Craig Grannell

"The Essential Guide to CSS and HTML Web Design"

If
you want to add a single quote mark (often used as an apostrophe online, when
???smart??? quotes aren??™t being used), you must escape the character first, using a backslash,
like so: \'. If you wish to add a double quote mark, you need to define it as an
HTML entity: ".
Adding captions to your image gallery
USING LINKS AND CREATING NAVIGATION
187
5
Automated gallery scripts
The kind of script mentioned in the previous exercise is great for creating a gallery finetuned
to your specific website: you can control the styles and positioning with ease.
However, there are a number of ready-made scripts online, one of the best of which is
Lightbox2 (www.huddletogether.com/projects/lightbox2/), by Lokesh Dhakar. The
script is highly automated, darkening the screen and providing next/previous buttons,
along with the capability to rapidly add captions.
In terms of setup, you attach the various scripts and the CSS file from the download files,
and check the paths to the included images (which can be replaced, if you don??™t like the
defaults). You then simply add rel="lightbox" to any link or thumbnail that??™s to be used
to activate the lightbox script. The optional title element enables you to add a caption.
?? src="assets/image-1-t.jpg" alt="thumbnail" width="100"
?? height="75" />

It??™s also possible to add more complex captions, including links, by using character entities
to encode the <, >, and " characters when adding HTML.


Pages:
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281