Browse DevX
Sign up for e-mail newsletters from DevX


Twelve Dynamic HTML Lessons : Page 8

From Cascading Style Sheets to higlighted text to toggling images on and off the page, here are twelve fancy things that you can learn to do today in DHMTL.

Spanning the Web
Short lesson this time. Really short.

Ok, remember our friend <div> that we've been using all along? Well he's got a sister named <span> who works just like him, except she doesn't force new lines. So you can use <span> inline in your text to assign styles and ID's to different parts of your documents that you can then manipulate.

So, suppose you want to set a highlight on just one word in a paragraph, like we just did. Instead of setting a font tag, which really isn't what we needed, just use <span></span> to mark the section. This also means that once you've marked a section you can perform many of the same DHTML and CSS style tricks you've learned.

That's it for this lesson, short and sweet. The next lesson will provide you with some useful JavaScript.

Thanks for your registration, follow us on our social networks to keep up-to-date