Using HTML and XHTML Tags With Cascading Style Sheets
CSS definitions can be applied to HTML and XHTML tags. It may seem that you can use any tag indiscriminately. But this is not exactly true. These tags are divided into logical categories. <doctype> The doctype tag is placed at the beginning of the webpage code. It is not a CSS style selector but it tells the web browser what DTD or Document Type Definition to use when displaying your webpage. You can think of a DTD as a set of rules that the web browser must follow. Anyone can make a set of DTD rules, but the ones used most often are those created by the World Wide Web Consortium. Some older web browsers do not recognize the DTD but the newer versions do. These newer versions are Netscape 6, Internet Explorer 5 (Mac), Internet Explorer 6 (Windows) and Mozilla 1. If no DTD is referenced by a doctype tag, the web browser will use its own default rules instead. For CSS webpages there are three DTD to choose from. Strict - This DTD tells the browser to use only CSS formatting and no HTML formatting on the webpage.
Block-level tags - These tags will create a line break both before and after the element. For example, when you apply a CSS style to a title (the element) using the <center> center tag, this causes a line break before and after the title. Inline tags - These tags will not create a line break. For example, when you apply a CSS style to text using the <b> bold tag, the section of bold text is not separated from the rest of the text that surrounds it. Replaced tags - These tags have their own built-in dimensions. For example, when you apply a CSS style to an image using the <img> image tag, this tag has height and width dimensions. | ||||||
This site needs an editor - click to learn more!
Editor's Picks Articles
Top Ten Articles
Previous Features
Site Map
Content copyright © 2023 by Diane Cipollo. All rights reserved.
This content was written by Diane Cipollo. If you wish to use this content in any manner, you need written permission. Contact
BellaOnline Administration
for details.