Attached is an example. (Inline here as well.)
<!--Saved by Quest 5.5.5328.26617-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="testbed3">
<gameid>d7aa6b29-5319-443f-b588-398262d962b2</gameid>
<version>1.0</version>
<css><![CDATA[
<style type="text/css">
span.keyword { color:#c0c080; font-style:italic }
span.hint {color:#80A01E; font-size:10pt; }
</style>
]]></css>
<start type="script">
msg(game.css)
</start>
</game>
<object name="room">
<inherit name="editor_room" />
<enter type="script"><![CDATA[
msg ("There is a <span class=\"keyword\">magic table</span> in the corner of the room.<br><br><span class=\"hint\">You can't click keywords, but you can type them.</hint>")
]]></enter>
<object name="player">
<inherit name="defaultplayer" />
<object name="box" />
<object name="ball" />
</object>
</object>
</asl>
There are various ways to do it. The approach I usually take is to have a string attribute on some object that will hold the CSS (style sheet) text. When you print (msg) the CSS string (or better yet, Print Message (no line break)), it gets injected into the page, and the styles are active. The downside is that if you clear the screen, you will lose your styles! I usually have my own clear screen function, which calls the Quest one and then outputs the style sheet.
The other problem with string attributes is that they don't show a multi-line edit field in the editor, so they're a pain to enter that way. I usually have to resort to code view to get them in properly.
So the steps in the sample file are:
1) Define a "css" string somewhere with your styles as a standard css style sheet.
2) Output that css string before you use the styles to get the styles into the page.
3) Reference the styles as "class" attributes of the spans (or divs or whatever you wish) when you output the content.
Using this technique with divs and css styles, I've been able to create fairly complex layouts - whatever you can accomplish with HTML/CSS.
There is a function in Quest that allows you to add external style sheets. It's used primarily to inject Google Fonts. In the past, we've tried to use it to inject our own local style sheets, with no success. I'm not sure if this was ever fixed.
The important things about style sheets are that, first, you can define all your styles in one place; second, you separate the content from how it's styled; and third, you can have a single definition for elements that are used repeatedly (e.g. you can have mulitple pieces of string with the "keyword" class, and if you change the style sheet in that one place, they all change style).