Scripting Web Pages

When used in conjunction with your HTML markup, scripts — small programs that you add to your Web page — help your Web pages respond to user actions. Scripts create the interactive and dynamic effects you see on the Web, such as images that automatically change when visitors move mouse pointers over them, additional browser windows that pop up when a page loads, and animated or interactive navigation bars. Because scripts are mini-programs, they’re often written in a programming language called JavaScript. If you’re unfamiliar with the...

read more

Working with style classes in CSS

Sometimes you need style rules that apply only to specific instances of an HTML markup element. For example, if you want a style rule that applies only to paragraphs that hold copyright information, you need a way to tell the browser that a rule has a limited scope. To target a style rule closely, combine the class attribute with a markup element. The following examples show HTML for two kinds of paragraphs: ✓ A regular paragraph (without a class attribute) <p>This is a regular paragraph.</p> ✓ A class attribute with the value...

read more

What you can do with CSS

What you can do with CSS You have a healthy collection of properties to work with as you write your style rules. You can control just about every aspect of a page’s display — from borders to font sizes and everything in-between: ✓ Background properties control the background colors associated with blocks of text and with images. You can also use these properties to attach background colors to your page or to individual elements, such as horizontal rules. ✓ Border properties control borders associated with a page, lists, tables, images,...

read more

Nesting lists in HTML

You can create subcategories by nesting lists within lists. Some common uses for nested lists include ✓ Site maps and other navigation tools ✓ Tables of content for online books and papers ✓ Outlines You can combine any of the three kinds of lists to create nested lists, such as a multilevel table of contents or an outline that mixes numbered headings with bulleted list items as the lowest outline level. The following example starts with a numbered list that defines a list of things to do for the day and uses three bulleted lists to...

read more

Bulleted lists in HTML

A bulleted list consists of one or more items each prefaced by a bullet (often a big dot; this book sometimes uses check marks as bullets). You use this type of list if the items’ order of presentation isn’t necessary for understanding the information presented. Formatting A bulleted list requires the following: ✓ The unordered list element (<ul>) specifies a bulleted list. ✓ A list item element (<li>) marks each item in the list. ✓ The closing tag for the unordered list element (</ul>) indicates that the list has...

read more