The default value of font-style is, as we can see,normal. This refers to "upright"text, which is probably best described as "text that is notitalic or otherwise slanted." The vast majority of text in thisbook is upright, for instance.

That Book HomeCascading Style Sheets: The Definitive GuideSearch this book Saturday 19th of April 2014 02:24:08 PM


9.6. Summary

When it comes right down to it, positioning is a very compelling technology. It's also likely to be an exercise in frustration if you're trying to get it to behave consistently in a cross-browser environment. The problem isn't so much that it won't work in some browsers: it's that it will only sort of work in a number of them, such as Navigator 4 and Internet Explorer 4 and 5. It can be great fun to play with positioning, and one day we'll be able to use it in place of tables and frames while dramatically improving accessibility and backward compatibility. As of this writing, though, it remains a great way to create design prototypes, but a tricky thing to use on a public web site.

As it happens, this sentiment may be applied to the majority of CSS2, which is given an overview in the next chapter.



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.

B {font-weight: bold;}

This says, simply, that the B element should bedisplayed using a boldface font; or, to put it another way, a fontthat is heavier than is normal for the document, as shown in Figure 5-8. This is what we're used to, of course,since B does cause text to be boldfaced.

Figure 5-8

Figure 5-8. Making the B tag bold

However, what's really happening is that a heavier variant ofthe font is used for displaying a B element. Thus,if you have a paragraph displayed using Times, and part of it isfloated image has a right margin of 5 pixels (5px). You would expect the document to be rendered very much as shown inFigure 8-39.

Figure 8-39

Figure 8-39. Expected floating behavior

Nothing unusual there, of course, but Figure 8-40shows what happens when we set the first paragraph to have abackground.

Figure 8-40

Figure 8-40. Backgrounds and floated elements

Web-based applications are similar to app servers, except for one thing: Web-based applications don't have client apps, instead they use web browsers on the client side. They generate their front ends using HTML, which is dynamically generated by the web-based app. In the Java world, Servlets are best suited for this job.

Web-based apps might themselves rely on another app server to gather information that is presented on the client web browser. Also, you can write Servlets that get information from remote or local databases, XML document repositories and even other Servlets. One good use for web-based apps is to be a wrapper around an app server, so that you can allow your customers to access at least part of the services offered by your app server via a simple web browser. So web-based apps allow you to integrate many components including app servers, and provide access to this information over the web via a simple web browser.

Web-based apps are very deployable, since they don't require special Java VMs to be installed on the client side, or any other special plug ins, if the creator of the web-based app relies solely on HTML. Unfortunately, this can restrict the level of service that can be offered by a web-based app when compared to the functionality offered by custom clients of an app server, but they are a good compromise when it comes to providing web-based access to your information. In fact, in a real world scenario, both a web-based app and app server may be used together, in order to provide your customers access to their information. In an Intranet setting, you might deploy the clients that come with the app server, and in an Internet setting it would be better to deploy a web-based app that sits on top of this app server, and gives your customers (relatively) limited access to their data over the web (via a simple web browser).

300 pixels tall by 300 pixels wide. Then, assume that only the bottomright third of it should be visible. We can get the desired effect(shown in Figure 6-45) like this:

BODY {background-image: url(bigyinyang.gif);background-repeat: no-repeat;background-position: -200px -200px;}
Figure 6-45

Figure 6-45. Using negative length values

Or, let's say we want a little more of it visible, as in Figure 6-46:

Here we see that not every line reaches to the right edge of theparagraph's content area, which has been denoted with a dottedgray border. The end of each line box is determined by the content ofthe line box. For comparison, let's try the same thing, butthis time right-justify the paragraph, as shown in Figure 8-48.

Figure 8-48

Figure 8-48. Line-box layout with right justification

Again, all we have here are the pieces of a single line of text whichhave been stacked on top of one another with their right sides linedup with each other. If we had set the paragraph to have a