Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Q. When I try to apply an inline style to a single word, it is applied to the entire text block instead. What am I doing wrong?
A. When you create an inline style, the new style is applied to the closest tag. That means that, unless you have separated the single word from the rest of the block using the <span> tags, the inline style will be applied to the block tag. To apply the inline style to a single word, you have to wrap it in <span> tags first and then create the new inline style.
Q. I followed the tutorial to create divs in code view, but everything looks the same as it did before!
A. When there is a problem with content being wrapped with <div> or <span> tags and nothing looking any different, the answer is usually answered by the following three questions: Does the <div> or <span> actually wrap anything? A common mistake when inserting these elements is to forget to place the end tag at the end of the content. This is because both IntelliSense and other tools automatically place the end tag right after the beginning tag before the content. The second question is, do the tags close properly? You might have forgotten to paste the end tag in after cutting it out, or you might have placed it in the wrong spot. If so, the code will be broken, and you should see the little warning sign in the status bar and find highlighted code further down in the document. Finally, did you actually apply the class or ID to the tag? If you click the content that should be styled by the class or ID, and the Quick Tag Selector reads <div> or <span> without the class or style attached, you need to apply the style or ID to make everything work properly.