The style attribute allows you to declare inline styles. Separate multiple styles with a semicolon. : style « Tags « HTML / CSS






The style attribute allows you to declare inline styles. Separate multiple styles with a semicolon.

  

<?xml version = "1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns = "http://www.w3.org/1999/xhtml">
   <head>
      <title>Inline Styles</title>
   </head>

   <body>
      <p>This text does not have any style applied to it.</p>

      <p style = "font-size: 20pt">This text has the 
      <em>font-size</em> style applied to it, making it 20pt.
      </p>

      <p style = "font-size: 20pt; color: #0000ff">
      This text has the <em>font-size</em> and 
      <em>color</em> styles applied to it, making it
      20pt. and blue.</p>

   </body>
</html>

   
  








Related examples in the same category

1.Declaring a style sheet in the header section
2.Embedded Style Sample
3.Two Embedded Style
4.Styling text with CSS
5.'style' Example