SGMLXML.net A place for SGML and XML application developers.

July 26, 2007

I’ve Become a Font Snob

Filed under: Books,CSS,Rants/Musings,XML,XSL — cangione @ 1:05 am

It’s two in the morning. I’ve been done with the content of the document I’m working on for two hours and I just finished selecting the fonts I’m going to use. This is kinda geeky even by my standards.

I blame “The NON-DESIGNER’S COLLECTION” by Robin Williams and John TOLLETT. After reading the three books I guarantee you will never look at serif and sans serif fonts the same way again. After a couple of arduous hours, I’ve finally selected “Franklin Gothic Medium” as my sans serif font and “Book Antiqua” as my serif font, although I would have preferred to use “RotisSemiSerif” but didn’t feel like paying 200 bucks for the font.

Charles Angione

March 22, 2006

The Underscore Hack

Filed under: CSS — cangione @ 6:36 pm







We all know that IE is not the best at supporting the web standards. This leads properly coded web pages to look awful at times including this site! My typical web browser is Firefox where the pages on sgmlxml.net look great. I still have some wayward friends that use IE so I was experimenting with making the pages look better in IE.

There are a couple of different techniques talked about on the web for this problem. The one that I prefer after some experimentation is the Underscore Hack. The hack works because IE is not the brightest browser in the world. An underscore in CSS is designed to act as a comment for that attribute only, and all browsers but IE honor this.

.text {
       margin: 10px;
       _margin: 15px;
}

NOTE: You have to place the underscore rule after the real attribute since IE sees both but uses the last one it sees.


December 20, 2005

Toggle colors on html span element using Javascript

Filed under: CSS,DOM,XSLT — cangione @ 11:31 pm

Javascript for changeing the color of span elements with a particular class attribute.

<tt>&lt;<span class="start-tag">script</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text/javascript"</span>&gt;</tt><br />
  <tt>function changecolor() {</tt><br />
  <tt>    for (i=0;i&lt;document.getElementsByTagName("span").length;
i++) {</tt><br />
  <tt>        if
(document.getElementsByTagName("span").item(i).className == "myclass"){</tt><br />
  <tt>           
document.getElementsByTagName("span").item(i).style.color = "green";</tt><br />
  <tt>        }</tt><br />
  <tt>    }</tt><br />
  <tt>}</tt><br />
  <tt>&lt;/<span class="end-tag">script</span>&gt;</tt><br />
  <br />
  <tt>.......</tt><br />
  <br />
  <tt>&lt;<span class="start-tag">a</span><span class="attribute-name">
href</span>=<span class="attribute-value">"#" </span><span class="attribute-name">onclick</span>=<span class="attribute-value">"changecolor();"</span>&gt;Change
Color&lt;/<span class="end-tag">a</span>&gt;</tt><br />
  <br />
  <tt>.......</tt><br />
  <br />
  <tt>&lt;span class="myclass"&gt;Hi There&lt;/span&gt;</tt><br />

April 7, 2005

CSS maxheight and maxwidth properties

Filed under: CSS — cangione @ 1:35 am




Internet Explorer does not support the maxheight and maxwidth properties of CSS2. Firefox supports them fine.

CA

March 24, 2005

Setup XML for Arbortext Epic Editing and Direct Web Browser Display using CSS

Filed under: CSS,Software,XML — cangione @ 4:38 pm

There are times when working with XML documents that it would be nice
to be able to style the document directly. To do this with CSS here is
a recipe that works with Internet Explorer, Firefox and the Arbortext
Epic Editor.

  1. Add a css stylesheet reference in your XML document.
    &lt;?xml-stylesheet
    href="docbook.css" type="text/css"?&gt;

  2. Modify you XML document to hide the doctype declaration in a
    comment. This stops IE from looking for it but still allows Epic to
    find it. If you are only interested in making it work with Firefox you
    can skip this step.

    &lt;?xml version="1.0"
    encoding="utf-8"?&gt;<br />
    &lt;?xml-stylesheet href="docbook.css" type="text/css"?&gt;<br />
    &lt;!-- Fragment document type declaration subset:<br />
    Arbortext, Inc., 1988-2004, v.4002<br />
    &lt;!DOCTYPE set PUBLIC "-//Arbortext//DTD DocBook XML V4.0//EN"<br />
     "axdocbook.dtd"&gt;<br />
    --&gt;

  3. Set writenonasciichar=char in Epic and save the XML
    document. This writes all of the character entities that may be present
    out as characters so the web browsers don’t complain about not being
    able to find the reference. This needs to either be set every time you
    edit the instance in Epic or via an ACL package.
  4. Create your CSS. A small sample docbook.css:
    book {<br />
            }<br />
    book&gt;title {<br />
      display:block;<br />
      font-size:3em;<br />
      color:inherit;<br />
      background:inherit;<br />
      font-weight:bold;<br />
    }<br />
              <br />
    legalnotice{<br />
            font-weight:bold;<br />
    }<br />
              <br />
    title {<br />
      display:block;<br />
      font-size:1.3em;<br />
      color:inherit;<br />
      background:inherit;<br />
      font-weight:bold;<br />
    }<br />
    para {<br />
            display:block;<br />
            padding: 20px;<br />
    }

CA

Suppress the br element using CSS

Filed under: CSS — cangione @ 1:00 am

I have run into issues with the <br> element especially with
programs that convert things to HTML. A quick way to suppress all of
the breaks is to add the following to your CSS stylesheet:

br { display: none;}

CA

Powered by WordPress