<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="../stylesheets/yaps-tei.css"?>
<?oxygen RNGSchema="../schema/yaps.rnc" type="compact"?>
<?oxygen SCHSchema="../schema/yaps.sch"?>
<TEI xmlns="http://www.wwp.brown.edu/ns/yaps/1.0" xmlns:xi="http://www.w3.org/2001/XInclude" version="5.0">
  <teiHeader>
    <fileDesc>
      <titleStmt>
        <title>Making a TEI File Look Good in a Browser</title>
        <author>Syd Bauman</author>
      </titleStmt>
      <editionStmt>
        <edition>Texas A &amp; M University</edition>
      </editionStmt>
      <publicationStmt>
        <distributor>Women Writers Project (via website)</distributor>
        <address>
          <addrLine>wwp@Brown.edu</addrLine>
        </address>
        <date when="2009-04-18"/>
        <availability status="restricted">
          <p>Copyright 2007 Syd Bauman, Julia Flanders, and Brown WWP</p>
	  <p>This TEI-encoded XML file is available under the terms of
	  the <ref target="http://creativecommons.org/licenses/by-sa/3.0/">Creative
	  Commons Attribution-ShareAlike 3.0 (Unported)</ref>
	  license.</p>
        </availability>
        <pubPlace>Providence, RI  USA</pubPlace>
      </publicationStmt>
      <sourceDesc>
        <p>based on same talk given 2007-09-19 at the Transliteracies Project and Early Modern
	Center at the University of California, Santa Barbara</p>
      </sourceDesc>
    </fileDesc>
    <revisionDesc>
      <change who="#sbauman.emt" when="2008-04-30">Remove stuff now duplicated on handout; fix wording of reference to spec</change>
      <change who="#sbauman.emt" when="2008-04-12">Changed <q>elem</q>
      to <q>element</q>, removed erroneous space from an example, and
      added CSSZenGarden link.</change>
      <change who="#sbauman.emt" when="2008-02-29">Chnaged from using
      <q>gi</q> to <q>elem</q> for generic identifier in selector
      templates</change>
      <change>automatically converted from presentation.odd conforming
      to yaps.odd conforming using p2y.xslt and p2y.perl</change>
    </revisionDesc>
  </teiHeader>
  <text>
    <presentation>
      <section>
        <head>What, me worry?</head>
        <slide>
          <p>I am not a CSS expert. I use it, that's all.</p>
        </slide>
      </section>
      <section>
        <head>CSS Stylesheets</head>
        <slide>
          <p>Allow you to associate a <term>style</term> (i.e.,
            typeface, size, color, spacing, etc.) to elements of XML
            documents.</p>
	    <p>Syd &#x2014; show &#x2019;em this slide using <name type="file">css_demo-html.css</name>, instead.</p>
        </slide>
        <handoutNote>
          <p>This is more of a brief crib sheet than a real CSS2
            reference. It is intended to provide you with a few
            useful selectors, properties, and values, just to get
            you started. For detailed information see the CSS 2.1
            specification itself, or any one of the many on-line
            tutorials. The prompts from your CSS editor may also
            prove helpful, as may a stroll through
            http://www.csszengarden.com/.</p>
        </handoutNote>
      </section>

      <sectionGrp>
	<head>Some CSS2 Snippets</head>
	<section>
	  <head>Basic black</head>
	  <slide>
	    <p>XML:</p>
	    <eg>&lt;greeting>Hello, world!&lt;/greeting></eg>
	    <p>CSS:</p>
	    <eg>greeting { font-size: x-large; font-stretch: wider; font-style: italic; }</eg>
	    <p>Output:</p>
	    <eg><hi rend="css(font-size: x-large; font-stretch: wider; font-style: italic;)">Hello, world!</hi></eg>
	  </slide>
	</section>
	<section>
	  <head>Cue color</head>
	  <slide>
            <eg><![CDATA[<p><persName>Owl</persName> lived at The Chustnuts, an old-world residence
<lb/>of great charm, which was grander than anybody
<lb/>else's, or seemed so to <persName>Bear</persName>, because it had both a
<lb/>knocker <emph>and</emph> a bell-pull … </p>]]></eg>
	    <eg>persName { color: blue; }
emph { font-weight: bold; color: #806010; }
lb { display: block; }</eg>
            <eg><hi rend="css(color:blue;)">Owl</hi> lived at The Chustnuts, an old-world residence
of great charm, which was grander than anybody
else's, or seemed so to <hi rend="css(color:blue;)">Bear</hi>, because it had both a
knocker <hi rend="css(font-weight: bold; color: #806010;)">and</hi> a bell-pull … </eg>
	  </slide>
	</section>
	<section>
	  <head>Slightly more realistic</head>
	  <slide>
	    <eg>teiHeader { display: none; }
body { 
  margin: 1em 1em 1em 1em;
  background-color: green;
  font-family: Helvetica,san-serif;
  }
div[type='chapter'] {
  display: block;
  border-width: thin;
  border-color: forestgreen;
  border-style: solid;
  }</eg>
	  </slide>
	</section>
	<section>
	  <head>Quotes</head>
	  <slide>
	    <eg><![CDATA[<said><quote>To be or not to be?</quote>, to walk or
not to walk…oh, <emph>hang</emph> it all!</said>]]></eg>
	    <eg>quote:before, said:before {
  content: open-quote;
  }
quote:after, said:after {
  content: close-quote;
  }
quote, said {
  quotes: "“" "”" "‘" "’";
  }</eg>
	    <eg>“‘To be or not to be?’, to walk or
not to walk…oh, hang it all!”</eg>
	  </slide>
	</section>
      </sectionGrp>

      <section>
        <head>Supported Browsers</head>
        <slide>
          <p>All modern browsers support CSS for HTML, <ref target="http://www.webdevout.net/browser-support-css">some
          more, some less</ref>. Most support CSS for XML: notably,
          though, not some (all?) versions of MSIE.</p>
        </slide>
	<lectureNote>
	  <p>Some browsers with varying degrees of support for CSS
	  include Internet Explorer, Firefox, Safari, Camino, iCab,
	  Opera, Radon, OmniWeb, Nova X, Sunrise, Xyle scope,
	  Netscape, Seamonkey, Demeter, and Shiira.</p>
	</lectureNote>
      </section>

      <section>
        <head>Other Support</head>
        <slide>
          <list>
            <head>Editors</head>
            <item>oXygen provides color syntaxing, indentation, and
                <soCalled>validation</soCalled></item>
            <item>CSSEdit provides color syntaxing, some
              indentation, completion, and a GUI interface for
              styles</item>
            <item>Emacs has a css-mode, of coures</item>
            <item>Those are the ones I've used; there are dozens of
              others</item>
          </list>
        </slide>
      </section>

      <section>
        <head>What is CSS2?</head>
        <slide>
	  <p>CSS2 stands for &#x201C;Cascading Style Sheets, level
	  2&#x201D;, and is a World Wide Web Consortium
	  specification.</p>
          <p>The specification itself can be found <ref target="http://www.w3.org/TR/CSS21/">on-line at the
              W3C site</ref>.</p>
          <p>CSS3 has been around for a long time, but is still at an
	    earlier stage of development, and has poor browser support.</p>
        </slide>
      </section>

      <section>
        <head>Basic Usage: syntax</head>
        <slide>
          <p>The core of the stylesheet consists of a series of
              <soCalled>rulesets</soCalled>. Each has the same basic
            syntax.</p>
          <p xml:id="bus">
            <code>selector { property: value; }</code>
          </p>
        </slide>
        <handoutNote>
          <eg>selector {
   property1: value1;
   property2: value2;
   ...
   propertyN: valueN
   }</eg>
          <p>Most of the whitespace outside of the selector is
            insignificant.</p>
        </handoutNote>
      </section>

      <section>
        <head>Basic Usage: selectors</head>
        <slide>
          <list>
            <head>some selectors</head>
            <item>element</item>
            <item>element descendant-element</item>
            <item>element &gt; child-element</item>
            <item>element[attr="value"]</item>
          </list>
          <p>Selectors may be combined simply by listing them
          left-to-right. Complete list is available <ref target="http://www.w3.org/TR/CSS21/selector.html#q1">in the
          specification</ref>.</p>
        </slide>
        <handoutNote>
          <list>
            <label>me</label>
            <item>matches any <gi>me</gi> element</item>
            <label>foo &gt; bar</label>
            <item>matches any <gi>bar</gi> element that is a child
              of a <gi>foo</gi> element</item>
            <label>foo bar</label>
            <item>matches any <gi>bar</gi> element that is a
              descendant of a <gi>foo</gi> element</item>
            <label>primo:first-child</label>
            <item>matches any <gi>primo</gi> element that is the
              first child of its parent</item>
            <label>foo[bar]</label>
            <item>matches any <gi>foo</gi> element that has a
                <att>bar</att> attribute, whatever the value</item>
            <label>foo[bar="Cheers"]</label>
            <item>matches any <gi>foo</gi> element that has a
                <att>bar</att> attribute with the value
              <val>Cheers</val></item>
            <label>foo[bar~="horizontal"]</label>
            <item>matches any <gi>foo</gi> element whose
              <att>foo</att> attribute value is a list of
              space-separated values, one of which is exactly equal
              to <val>warning</val></item>
          </list>
          <p>Multiple selectors may be used at once, separated by
            commas. E.g.:
            <eg>name[type="person"], persName { color: red; }</eg></p>
          <p>I have not gotten a CSS2 selector to work for
              <att>xml:id</att> whether using
              <code>[xml:id='whatever']</code> or the short-hand
              <code>#</code> selector.</p>
        </handoutNote>
      </section>

      <section>
        <head>Associating Stylesheet with XML Instance</head>
        <slide>
          <p>To tell a browser which stylesheet to use, put the
            following after the XML declaration, but before the
            DOCTYPE declaration (if any)</p>
          <eg><![CDATA[<?xml-stylesheet type="text/css" href="my.css"?>]]></eg>
          <p>For example: <eg><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="../stylesheets/yaps-tei.css"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0" xml:lang='en'>]]></eg>
          </p>
          <p>In HTML or XHTML <gi>link</gi> can be used instead.</p>
        </slide>
      </section>

      <section>
	<head>The Zen of CSS</head>
	<slide>
	  <p>One excellent way to see the power of CSS and learn it is
	  to stroll through the <ref target="http://www.csszengarden.com/">CSS Zen
	  Garden</ref>.</p>
	</slide>
      </section>
    </presentation>
  </text>
</TEI>
