Style sheets and HTML documents

Before we start looking into how SimplyHTML implements the use of Documents, we should spend some time on reviewing how HTML documents and Cascading Style Sheets (CSS) are related.

What are CSS styles

Styles in CSS syntax are an extension to 'plain' HTML that allow to define attributes describing how HTML content should look. With styles one can define that paragraphs should always have a 6pt margin at the top for instance or that headlines always should be shown in red letters of 18pt size using font Helvetica.

How styles can be used

HTML allows to combine content and styles all in one HTML file, for example by means of adding style attributes to HTML tags. Another way is to store a <style> tag in the <head> tag of the document.

In addition it is possible to store styles in files separated from an HTML file. Storing styles in Cascading Style Sheets (CSS) has the advantage that a set of common styles can be defined at a central location serving as the basis for an arbitrary number of HTML files.

How SimplyHTML uses styles

In SimplyHTML a combination of styles defined separately in style sheets and styles defined as attributes within HTML tags is implemented. Whenever possible SimplyHTML avoids HTML tags such as <font> in favour of styles.

See 'Style handling design in SimplyHTML' for additional details.