What Is a Style Tag/Element


What Is a Style Tag/Element? - XHTML 1.0 Tutorials - Document Structure and Head Level Tags

✍: FYIcenter.com


A "style" element is an optional sub-element of the "head" element. A "link" element is used to specify Cascading Style Sheet (CSS) entries. Here is good example of a style element:

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  <title>My Second CSS Example</title>
  <style type="text/css">
    body {background-color: #dddddd}
  <p>Hello world!</p>

If you save the above document as hello.html, and view it with Internet Explorer, you will see a gray background specified by the CSS entry in the "style" element.

2007-05-12, 4623👍, 0💬