40 likes | 226 Views
Bold and Italics. Bold and Italic Text in XHTML:. We can italicize and bold text in CSS by using the "font-style:italic" and "font-weight:bold" styles. Another method is to use the <em> ("emphasis") and <strong> tags.
E N D
Bold and Italic Text in XHTML: • We can italicize and bold text in CSS by using the "font-style:italic" and "font-weight:bold" styles. • Another method is to use the <em> ("emphasis") and <strong> tags. • A third method is to use the <i> and <b> tags. These are often seen in older, existing web pages. Avoid using these, as the first two methods are now preferred.
Bold and Italics via CSS: <head> <style type="text/css"> h2 { font-style:italic; } h3 { font-weight:bold; } h4 { font-style:italic; font-weight:bold; } </style> </head> Heading in Italics Heading in Bold Heading in Bold and Italics CSS is the preferred way of styling text in bold and italics. <body> <h2>Heading in Italics</h2> <h3>Heading in Bold</h3> <h4>Heading in Bold and Italics</h4> </body>
Bold and Italics via <strong> and <em>: <body> <h2> <em>Heading in Italics</em> </h2> <h3> <strong>Heading in Bold</strong> </h3> <h4> <em><strong> Heading in Bold and Italics </strong></em> </h4> </body> Heading in Italics Heading in Bold Heading in Bold and Italics Although considered an acceptable method for making text italic and bold, <em> and <strong> are best reserved for those situations in which there is a semantic (meaningful) difference in the text. For example, <em> is the preferred method when the text to be italicized is a book title, ship name, or foreign phrase.