|
What are Styles?
Using Styles and Dynamic HTML allows us to do more than we could with HTML 3.0 and 3.2
Can We Continue to Use the Old and Familiar HTML Tags?
Formatting With Styles Examples The sample of HTML code below shows how we have traditionally formatted some text using the <h3> to indicate a heading and the <font> tag to specify a specific font and font color. <HTML> The code below achieves the same effect using Styles. A style was created using the <style> tag and given a name of ".h3style". Notice that the style was created in the Head and not the Body. However, the style was applied to text in the Body. The code for creating the style and applying it are shown in red. <HTML> Creating and Applying a Style Using DreamweaverTo create styles in Dreamweaver, do the following:
To apply the style you have created, do the following:
Activity------------------------------------------------------------------
Defining Styles - What Styles Can We Define?This list indicates the functions of the style types. Notice that some of the styles do not display in Dreamweaver editor. You must preview them in a browser.Type: This style refers to typographical formatting and includes font, font size, color, line height, case (upper or lower) and others. Background: Background color, image and placement. Several interesting and advanced options are available. You can select how a background image is displayed. Normally, a background image is tiled to take up all available space. By selecting No Repeat, the image is displayed only once at the top. Repeat-x and Repeat-y display a horizontal and verical band of images, respectively. You can also use a background image as an Attachment that can be fixed in location, or scroll with the content. A small logo or image can be made to scroll to keep it visible at all times. Block: Typographic formatting applied to text. Includes space between words, space between characters, and how the text is vertically aligned with other elements. We see this used frequently with the <img> tag. It can also be used with other elements. Box: Width and Height determine the size of the element. Float moves the element out of the page flow and places it at either the left or right page margin. Other elements wrap around the floating element as usual. Clear defines on which sides of the element layers are not allowed. If a layer appears on the clear side, the element with the clear setting moves below it. Padding defines the amount of space between the content of the element and its border (or its margin if there is no border). Margin defines the amount of space between the border of the element and any other element. Border: Places a border around the selected object or text. Border attributes include width, style and color. List: Allows formatting of the type of bullet, a bullet image and placement of the bullet. Notice that Dreamweaver can insert the selected bullet graphic in a list for you. No need to type <img src=".......">. Positioning: Allows an image (for example) to be placed in an absolute location on the screen by placing it inside a new layer. You can set the visibility of an object inside a layer to visible or hidden, can set z-index so that one image is behind or in front of another image. Overflow allows you to specify what happens if an object is larger than the layer that holds it. Clip defines the part of a layer that is visible. Extensions: Pagebreak forces a page break when printing the page. It sounds like a nice feature, but is not supported by level 4 browsers, so at present there is no point in using it. Cursor changes the cursor when it moves over an object. Filter applies special effects that apply to an object. Note that this is only supported by Microsoft Internet Explorer. The effects will not appear in Netscape.
How Do You Apply a Style?
Activity------------------------------------------------------------------------------
|