Style Sheet Switching

by Tweak on June 12, 2009
in Html/Css, Javascript

By using a little Javascript, you can allow users to switch between different style sheets and dramatically alter the appearance of a web page’s layout.

This first method creates a persistent style sheet. This means that the style sheet will definitely be loaded and enabled for use on this web page. Most style sheets used on the web are loaded in this manner by placing this code in the head area of an HTML document. The properties of the style change when we add a title attribute, like so:

<link rel="stylesheet" type="text/css" href="preferred.css" title="solder" /> Read more…

Setting background colour and images in CSS

by Tweak on June 8, 2009
in Html/Css

With a few simple attributes, CSS can be used to control the background of most any item on a web page. The background of heavily used tags for page structure, including div, p, and td can be controlled by applying a style with the following background attributes.

Attributes (The Long and Easily Explanable Way)

background-color

This attribute defines a solid color in the background of an object. Word values for colors and hexadecimal values can be used for colors. If no background color is set, the color of the item immediately behind the object will show through. The background-color attribute can also skillfully be used in conjuction with background-image. Before the background image loads, and in areas of the object in which is not displaying, a color defined with background-color will show. Here is an example for defining a maroon background color:
Read more…