CSSID

CSSID
Styling with CSS, tells us about CSSID and Cascading Style Sheets.

> //Cascading Style Sheets (CSS) is a style language that defines the layout of one or more sections of HTML documents. Background colors, font colors and types, and image layering are just some of the special effects that can be achieved using CSS and Run BASIC. The CSS layout is defined using the CSSID command. Each CSS layout is given a unique name. Run BASIC then uses the DIV command to assign sections of the defined CSS layout.//

Syntax: CSSID #tag, ruleExpr$ - Define a CSS id rule with #tag and ruleExpr$

Run BASIC gives us the ability to format the display of the pages in our programs. The possibilities are nearly endless, so please read the article, Styling With CSS, to start learning about the many things you can do with the **CSSID** statement.

A typical CSSID statement looks like this:

code CSSID #CoolColor, " { Background-Color: yellow } " code

To apply the style to an outputted section of a web page, use the **DIV** and **END DIV** statements, like this:

code DIV CoolColor PRINT "Text displayed on color." END DIV code

The text in the code between **DIV** and **END DIV** is in the style specified in the **CSSID** statement. Notice that you must give the style a name that begins with a # character, but you do not use that character when issuing the **DIV** statement. The CSSID is "#CoolColor" and the DIV statement specifies "CoolColor".

Here is a tiny demo. The output from the code looks like this:



code format="vbnet" html " "

CSSID #CoolColor, " { Background-Color: yellow } " DIV CoolColor PRINT "Text displayed on color." END DIV

print "Text outside of DIVs."

CSSID #CoolBorder, " { Border-Style: Inset } "

DIV CoolBorder print "Text inside a border." END DIV code