September 22, 2007

SharePoint and CSS

Filed under: — admin @ 9:02 pm

SharePoint utilizes CSS quite heavily, and it is both a curse and a blessing. Since nearly all of the SharePoint 2003 UI is hard coded in the site definitions, CSS provides one of the best ways to update the UI. But the SharePoint CSS is also pretty unruly and can be quite daunting at first glance. Let’s go ahead and get the numbers out on the table.

For a SharePoint 2003 Portal and WSS install, there are 7 separate style sheets (excluding themes), totaling to 7,403 lines of code and 1,227 style statements. Ouch! Luckily some of that we can slash off pretty quick. Four of the seven style sheets I have yet to ever have to edit to affect a site (Menu.css, OWSmac.css, OWSnocr.css, Paystub.css). The other three are pretty easy:

  • SPS.css: SharePoint 2003 Portal style sheet
  • OWS.css: SharePoint 2003 Portal style sheet AND Windows SharePoint Services style sheet
  • OWSPERS.css: SharePoint 2003 Portal Personal Sites (My Sites) style sheet.
  • OWSPERS.css is a combination of a copy of SPS.css and OWS.css with a few things tweaked here and there. You can condense the style statements in OWSPERS.css to something more manageable and less repetitive. I tell you how here.

SPS.css and OWS.css have a few quirks. There are style selectors that are repeated in each. In some cases, the duplicate styles are not connected and control WSS and Portal separately, but in other cases the two are connected and what you have in one can possibly override the other, making for a confusing and frustrating situation. Additionally, the styles may share the same selector, but list different properties in the declaration.

When a portal page is rendered, it pulls in several style sheets, in this order 1) OWS.css; 2) MENU.css; 3) SPS.css.

When a WSS site is rendered, it pulls in the OWS.css style sheet and then the theme style sheet if a theme has been applied to a site.

The order of which the style sheets are called in the code is important. The way CSS works, generally the last property specified in a declaration for a selector is the property that is used for rendering the element. So if the same selector is in both SPS.css and OWS.css, a portal will use the declaration listed in SPS.css for the element because SPS.css is called after OWS.css in the code. This is the basis behind how themes work as well. In a theme, you only need to include updated declarations in the theme style sheet, and when the site is rendered the new declarations in the theme style sheet will override anything set in OWS.css.

Edit the CSS files on the web server

Portal/WSS: Both
Sites affected: Entire environment

Editing the style sheets directly used by SharePoint requires zero duplication of code and fast results, but can cause maintenance issues further down the road. With any patch or upgrade you run the risk of losing your changes. Your changes would have to be reapplied as opposed to other approaches of just resynching up pointers to custom style sheets. The other hindrance is that the SharePoint style sheets are very long and the number of styles you will actually end up needing to edit will pale in comparison to the final statement count in the files. So you will have to deal with a lot of finding of statements and wading through untouched statements. This is not the cleanest way to specify new styles.

Read more on how to use CSS on SharePoint


HTML Tidy for Windows

Filed under: — admin @ 9:04 pm

HTML Tidy is a tool that was originally written by Dave Raggett of the World Wide Web Consortium (W3C). It is designed to fix mistakes in HTML, tidy up the layout (hence the name), assist with web accessibility, convert HTML to XHTML and many other things.

The software is now maintained by a group of volunteers working as an Open Source Community at Source Forge and this is the place to go for more information.

I try to keep my system virus free but you do check downloaded files yourself, don’t you? These tools do not require any external libraries or environment. Just unzip them to where they are needed, preferably a folder which is in the search path.

This is a command line application so you will need a COMMAND.COM (Command prompt or DOS) window. Make sure that the tidy.exe is in a folder contained in the search path (defined in AUTOEXEC.BAT). The program is run using the command

Read more on using and installing HTML Tidy


Web Security Sourcebook

Filed under: — admin @ 9:05 pm

Hackers into personal and corporate web sites are viewed as invasive by computer professionals and consumers as traditional home burglars. On the browser side, three computer security experts offer break-in deterrent tips via user passwords and IDs, anti-cookie, and advanced anonymity strategies. Server-side security entails firewalls, privacy-conscious Java applets, CGI scripts, and encrypted payment protocols/products. An appendix deciphers cryptography basics. To further ensure that computer users don’t get caught in unsecured webs, the authors provide a companion web site.

Here’s book that’s valuable today and indispensable for the future. It includes basic and advanced techniques for client-side and server-side security, browser security, writing secure CGI scripts, firewalls, and secure e-commerce. There’s a special appendix that demystifies the complex world of cryptography. And the book comes with access to a dedicated Web site containing up-to-the-minute information on the latest security threats and solutions. So whether you’re a Webmaster trying to close the door on sites and applications, or an everyday user hoping to keep your desktop safe, this is your essential source on protecting and securing Web pages, search engines, servers, and browsers; writing impregnable applets and scripts, and avoiding the dangers inherent in every language; using (and abusing) firewalls and cryptographic controls; and securing commerce and payment transactions.

The technical tools and techniques for building secure Web sites and applications

The Web has made it easier to transfer information around the world. It has also made it harder to keep that information secure. This book shows Web masters, Web managers, and Web designers the hands on programming techniques necessary to build secure Web sites. Readers will learn how to secure the server, use firewalls and cryptography, write secure Java applets and CGI scripts and more. Companion Web Site includes source code examples plus updates on the latest security threats and techniques.

From the Back Cover “The authors . . . bring wide-ranging experience to this work, moving from theory to hands-on, bit-shoveling practical advice.” –Steven M. Bellovin A serious security sourcebook for Web professionals and users. The front door is unlocked and wide open. The alarm’s not working and no one’s home. All of your valuables, money, and intimate details of your life are just sitting inside, waiting to be taken. No, it’s not your house . . . it’s your computer. The Web now penetrates every aspect of our lives, from the home PC to the business office. But with each advance in convenience comes a geometric increase in vulnerability to the integrity of data and software as well as to the confidentiality of information. Although the flaws inherent in the Web are real, solutions are available. Let Aviel Rubin, Daniel Geer, and Marcus Ranum give you the answers. Here’s a book that’s valuable today and indispensable for the future. It includes basic and advanced techniques for client-side and server-side security, browser security, writing secure CGI scripts, firewalls, and secure e-commerce. There’s a special appendix that demystifies the complex world of cryptography. And the book comes with access to a dedicated Web site containing up-to-the-minute information on the latest security threats and solutions. So whether you’re a Webmaster trying to close the door on sites and applications, or an everyday user hoping to keep your desktop safe, this is your essential source on: *Protecting and securing Web pages, search engines, servers, and browsers *Writing impregnable applets and scripts, and avoiding the dangers inherent in every language *Using (and abusing) firewalls and cryptographic controls *Securing commerce and payment transactions

Source : http://avirubin.com/books/book1/


ebXML Registry Profile for Web Ontology Language (OWL)

Filed under: — admin @ 9:08 pm

OASIS announced the publication of a public review draft for the “ebXML Registry Profile for Web Ontology Language (OWL) Version 1.5″ specification, ending 11-February-2007. Produced by members of the OASIS ebXML Registry Semantic Content Management Subcommittee, this document defines the ebXML Registry profile for publishing, management, discovery, and reuse of OWL Lite Ontologies.

The SC was chartered to define use cases and requirements for managing semantic content within the ebXML Registry 4.0, seeking to establish a formal liaison with relevant groups within the Semantic Web Activity (SWA) at W3C. The requirements: must include the ability to utilize ontolgies for classifying RegistryObjects and to enable intelligent discovery using ontology based queries. The SCMSC was tasked to identify specific Semantic Web technologies (e.g. RDF, OWL) that are necessary to support the requirements identified for semantic content management. From the specification introduction: The ebXML Registry holds the metadata for the RegistryObjects and the documents pointed at by the RegistryObjects reside in an ebXML repository.

The basic semantic mechanisms of ebXML Registry are classification hierarchies (ClassificationScheme) consisting of ClassificationNodes and the Association Types among RegistryObjects. Furthermore, RegistryObjects can be assigned properties through a slot mechanism and RegistryObjects can be classified using instances of Classification, ClassificationScheme and ClassificationNodes.

Given these constructs, considerable amount of semantics can be defined in the registry. However, currently semantics is becoming a much broader issue than it used to be since several application domains are making use of ontologies to add knowledge to their data and applications. This document normatively defines the ebXML Registry profile for Web Ontology Language (OWL) Lite. More specifically, this document normatively specifies how OWL Lite constructs should be represented by ebXML RIM constructs without causing any changes in the core ebXML Registry specifications. Furthermore, this document normatively specifies the code to process some of the OWL semantics through parameterized stored procedures that should be made available from the ebXML Registry. Although this Profile is reIated to ebXML Registry specifications and not to any particular implementation, in order to be able to give concrete examples, the freebXML Registry implementation is used.

Source : ebXML.org


Web Accessibility Best Practices

Filed under: — admin @ 9:09 pm

The primary purpose of these HTML/XHTML Best Practices is to improve the accessibility of web resources at the University of Illinois at Urbana/Champaign for students, faculty, staff, and the general public.

The typical approach to web accessibility is a “repair” approach which focuses on meeting the technical requirements of either the Section 508 or W3C WCAG 1.0 accessibility standards. This accessibility repair usually results in the resources becoming more “technically accessible” but still remaining functionally unusable by many people with disabilities. These Best Practices avoid this problem by focusing on the functional requirements that improve access to all users, including people with disabilities. They are inspired by the needs of people with disabilities but are designed to give all users more options and control when accessing web resources, hence the name “user-centered” design practices.

In this user-centered approach, less assumptions are made about what technologies will be used to access a web resource and more options are provided that allow use of a broader range of technologies and the ability to restyle information for their own needs. Since all users benefit from this design approach, developers can functionally test their web resources using common web browsers and extensions to see if their resources conform to the user-centered design approach.

Source : http://html.cita.uiuc.edu/


September 23, 2007

Introduction to TIDY

Filed under: — admin @ 1:18 pm

When editing HTML it’s easy to make mistakes. Wouldn’t it be nice if there was a simple way to fix these mistakes automatically and tidy up sloppy editing into nicely layed out markup? Well now there is! Dave Raggett’s HTML TIDY is a free utility for doing just that. It also works great on the atrociously hard to read markup generated by specialized HTML editors and conversion tools, and can help you identify where you need to pay further attention on making your pages more accessible to people with disabilities.

Tidy is able to fix up a wide range of problems and to bring to your attention things that you need to work on yourself. Each item found is listed with the line number and column so that you can see where the problem lies in your markup. Tidy won’t generate a cleaned up version when there are problems that it can’t be sure of how to handle. These are logged as “errors” rather than “warnings”.

Dave Raggett has now passed the baton for maintaining Tidy to a group of volunteers working together as part of the open source community at Source Forge. The source code continues to be available under an open source license, and you are encouraged to pass on bug reports and enhancement requests at http://tidy.sourceforge.net.

If you find HTML Tidy useful and you would like to say thanks, then please send me a (paper) postcard or other souvenir from the area in which you live along with a few words on what you are using Tidy for. It will be fun to map out where Tidy users are to be found! My postal address is given at the end of this file.

The W3C public email list devoted to HTML Tidy is: <html-tidy@w3.org>. To subscribe send an email to html-tidy-request@w3.org with the word subscribe in the subject line (include the word unsubscribe if you want to unsubscribe). The archive for this list is accessible online. If you would like to contact the developers, or you just want to submit an enhancement request or a bug report, please visit http://tidy.sourceforge.net.

Tidy can now perform wonders on HTML saved from Microsoft Word 2000! Word bulks out HTML files with stuff for round-tripping presentation between HTML and Word. If you are more concerned about using HTML on the Web, check out Tidy’s “Word-2000″ config option! Of course Tidy does a good job on Word’97 files as well!

Tidy features in an article by Scott Nesbitt on webreview.com, and more recently on Dave Central’s Best of Linux, and as tool of the month on Unix Review by Joe Brockmeier, who writes:

“One thing I love about the UNIX philosophy is the idea that each program should do one job and do it really well. There are zillions of small tools for UNIX-type OSes that make life much easier and are hugely useful, but they don’t necessarily get written about. They certainly don’t receive the same kind of coverage that Apache and Sendmail receive. One of my favorites, HTML Tidy, is a tool for HTML/Web development that I think will interest a lot of folks. HTML Tidy cleans up HTML produced by WYSIWYG editors and such.”

Tidy is available as a downloadable binary, as source code (ANSI C), or as an online service at W3C, Info Network, HTML Help’s site Valet and other sites.

source : http://www.w3.org/People/Raggett/tidy/


The Semantic Web: An Introduction

Filed under: — admin @ 6:00 pm

The Semantic Web is a mesh of information linked up in such a way as to be easily processable by machines, on a global scale. You can think of it as being an efficient way of representing data on the World Wide Web, or as a globally linked database.The Semantic Web was thought up by Tim Berners-Lee, inventor of the WWW, URIs, HTTP, and HTML. There is a dedicated team of people at the World Wide Web consortium (W3C) working to improve, extend and standardize the system, and many languages, publications, tools and so on have already been developed. However, Semantic Web technologies are still very much in their infancies, and although the future of the project in general appears to be bright, there seems to be little consensus about the likely direction and characteristics of the early Semantic Web.

What’s the rationale for such a system? Data that is geneally hidden away in HTML files is often useful in some contexts, but not in others. The problem with the majority of data on the Web that is in this form at the moment is that it is difficult to use on a large scale, because there is no global system for publishing data in such a way as it can be easily processed by anyone. For example, just think of information about local sports events, weather information, plane times, Major League Baseball statistics, and television guides… all of this information is presented by numerous sites, but all in HTML. The problem with that is that, is some contexts, it is difficult to use this data in the ways that one might want to do so.

So the Semantic Web can be seen as a huge engineering solution… but it is more than that. We will find that as it becomes easier to publish data in a repurposable form, so more people will want to pubish data, and there will be a knock-on or domino effect. We may find that a large number of Semantic Web applications can be used for a variety of different tasks, increasing the modularity of applications on the Web. But enough subjective reasoning… onto how this will be accomplished.

The Semantic Web is generally built on syntaxes which use URIs to represent data, usually in triples based structures: i.e. many triples of URI data that can be held in databases, or interchanged on the world Wide Web using a set of particular syntaxes developed especially for the task. These syntaxes are called “Resource Description Framework” syntaxes.
URI - Uniform Resource Identifier

A URI is simply a Web identifier: like the strings starting with “http:” or “ftp:” that you often find on the World Wide Web. Anyone can create a URI, and the ownership of them is clearly delegated, so they form an ideal base technology with which to build a global Web on top of. In fact, the World Wide Web is such a thing: anything that has a URI is considered to be “on the Web”.

The syntax of URIs is carefully governed by the IETF, who published RFC 2396 as the general URI specification. The W3C maintains a list of URI schemes.

DF - Resource Description Framework

A triple can simply be described as three URIs. A language which utilises three URIs in such a way is called RDF: the W3C have developed an XML serialization of RDF, the “Syntax” in the RDF Model and Syntax recommendation. RDF XML is considered to be the standard interchange format for RDF on the Semantic Web, although it is not the only format. For example, Notation3 (which we shall be going through later on in this article) is an excellent plain text alternative serialization.

Once information is in RDF form, it becomes easy to process it, since RDF is a generic format, which already has many parsers. XML RDF is quite a verbose specification, and it can take some getting used to (for example, to learn XML RDF properly, you need to understand a little about XML and namespaces beforehand…), but let’s take a quick look at an example of XML RDF right now:-

<rdf:RDF xmlns:rdf=”http://www.w3.org/1999/02/22-rdf-syntax-ns#”
xmlns:dc=”http://purl.org/dc/elements/1.1/”
xmlns:foaf=”http://xmlns.com/0.1/foaf/” >
<rdf:Description rdf:about=”">
<dc:creator rdf:parseType=”Resource”>
<foaf:name>Sean B. Palmer</foaf:name>
</dc:creator>
<dc:title>The Semantic Web: An Introduction</dc:title>
</rdf:Description>
</rdf:RDF>

This piece of RDF basically says that this article has the title “The Semantic Web: An Introduction”, and was written by someone whose name is “Sean B. Palmer”. Here are the triples that this RDF produces:-

<> <http://purl.org/dc/elements/1.1/creator> _:x0 .
this <http://purl.org/dc/elements/1.1/title> “The Semantic Web: An Introduction” .
_:x0 <http://xmlns.com/0.1/foaf/name> “Sean B. Palmer” .

This format is actually a plain text serialization of RDF called “Notation3″, which we shall be covering later on. Note that some people actually prefer using XML RDF to Notation3, but it is generally accepted that Notation3 is easier to use, and is of course convertable to XML RDF anyway.

Source: Infomesh


XML Encryption Syntax and Processing

Filed under: — admin @ 6:02 pm

This document specifies a process for encrypting data and representing the result in XML. The data may be arbitrary data (including an XML document), an XML element, or XML element content. The result of encrypting data is an XML Encryption element which contains or references the cipher data.This document is the W3C XML Encryption Recommendation (REC). This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a W3C Recommendation. It is a stable document and may be used as reference material or cited as a normative reference from another document. W3C’s role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web.

This specification was produced by the W3C XML Encryption Working Group (Activity) which believes the specification is sufficient for the creation of independent interoperable implementations as demonstrated in the Interoperability Report.

Patent disclosures relevant to this specification may be found on the Working Group’s patent disclosure page in conformance with W3C policy.

This document specifies a process for encrypting data and representing the result in XML. The data may be arbitrary data (including an XML document), an XML element, or XML element content. The result of encrypting data is an XML Encryption EncryptedData element which contains (via one of its children’s content) or identifies (via a URI reference) the cipher data.

When encrypting an XML element or element content the EncryptedData element replaces the element or content (respectively) in the encrypted version of the XML document.

When encrypting arbitrary data (including entire XML documents), the EncryptedData element may become the root of a new XML document or become a child element in an application-chosen XML document.

Continue to read the full document on: http://www.w3.org/TR/xmlenc-core/


September 25, 2007

SMIL Animation

Filed under: — admin @ 6:23 pm

This is a W3C Recommendation of a specification of animation functionality for XML documents. It describes an animation framework as well as a set of base XML animation elements suitable for integration with XML documents. It is based upon the SMIL 1.0 timing model, with some extensions, and is a true subset of SMIL 2.0. This provides an intermediate stepping stone in terms of implementation complexity, for applications that wish to have SMIL-compatible animation but do not need or want time containers.

This section describes the status of this document at the time of its publication. Other documents may supersede this document. The latest status of this document series is maintained at the W3C.

This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a W3C Recommendation. It is a stable document and may be used as reference material or cited as a normative reference from another document. W3C’s role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web.

The SMIL Animation specification has been produced as part of the W3C Synchronized Multimedia Activity and was written by the SYMM Working Group (members only) of the W3C Interaction Domain, working with the SVG Working Group (members only) of the W3C Document Formats Domain. The goals of the SYMM Working Group are discussed in the SYMM Working Group charter (members only), (revised July 2000 from original charter version).

The SYMM Working Group (members only) considers that all features in the SMIL 2.0 specification have been implemented at least twice in an interoperable way. The SYMM Working Group Charter (members only) defines this as the implementations having been developed independently by different organizations and each test in the SMIL 2.0 test suite has at least two passing implementations. The Implementation results are publicly released and are intended solely to be used as proof of SMIL 2.0 implementability. It is only a snap shot of the actual implementation behaviors at one moment of time, as these implementations may not be immediately available to the public. The interoperability data is not intended to be used for assessing or grading the performance of any individual implementation.

There are patent disclosures and license commitments associated with the SMIL 2.0 specification (and thus with the SMIL Animation specification also), these may be found on the SYMM Patent Statement page in conformance with W3C policy.

Source : http://www.w3.org/TR/smil-animation/


Using Cascading Style Sheets on Your Web Site

Filed under: — admin @ 6:27 pm

Cascading style sheets give you more control over the appearance and presentation of your pages. Using cascading style sheets, you can extend the ability to precisely specify the location and appearance of elements on a page and create special effects. You can specify individualized style sheets for specialized browsers and output devices. Another advantage of using cascading style sheets on your Web site is the ability to reuse them across multiple pages. And by using an external style sheet, you can quickly change all the styles on your site by altering a single style sheet. This makes updating and maintaining your site much easier.

What is a Cascading Style Sheet?

The cascading style sheet is a recommendation of the World Wide Web Consortium (W3C). Level 1 of the cascading style sheet mechanism (CSS1) became a W3C recommendation in December 1996. It describes the CSS1 language as well as a simple visual formatting model. Cascading style sheets, level 2 (CSS2), which became a W3C recommendation in May 1998, builds on CSS1 and adds support for media-specific style sheets (such as for printers, monitors, and aural devices), downloadable fonts, element positioning, and tables. The CSS Mobile Profile became a W3C candidate recommendation in October 2001.

A style sheet is a set of instructions that tells a browser how to present a particular type of HTML element. Each instruction consists of a selector, which tells a browser which elements in a page are affected by the particular rule, and a set of properties, which tells a browser how to present any elements that are specified in the selector.

Here are some simple examples of style definitions defined in a cascading style sheet:

h1 { font-size: x-large; color: green }
h2 { font-size: large; color: blue
.caption { font-size: small }
#footer { font-family: verdana, arial }

In the example above, the h1 element and the h2 element are selectors that modify the formatting properties of standard HTML tags. The selectors’ properties and values are contained within the curly braces ({}). Font-size is a property, and x-large is the value of the font-size property. Multiple properties for a selector are separated with a semicolon.

In addition to selectors that link HTML elements to a particular style, there also are class selectors and id selectors.

A class selector is a stand-alone class to which a specific style is declared. The style of a class attribute can be associated with any HTML element. A class selector is created by a period followed by the class name. In the example above, .caption is a class selector, which identifies a user-defined style. In your HTML code, you would reference a class selector using the class statement:

<p class=”caption”>This element is associated with the caption class.</p>

Notice that although class selectors are prefixed with a period, you do not use the period when referencing them in a class statement.

It is a good practice to name class selectors according to their function rather than their appearance. The caption class in the example could have been named “small” but that would become meaningless if the author decided to change the style of the class so that it no longer had a small font size.

An id selector is individually assigned to define a style on a per-element basis. Using the id attribute, the declared style can be associated with only one HTML element per document to differentiate it from other elements. An id selector is declared by using the indicator #. In the example above, #footer is an id selector, which defines a style for an individual page element (usually as an inline style). This type of style would be referenced in HTML by the id attribute:

<p id=”footer”>This is the page footer and only this element will have this style.</p>

As with the class selector, you would not use the # symbol when referencing the style.
Three Types of Cascading Style Sheets: External, Embedded, and Inline

There are three ways that you can use style sheets on pages in your Web site:

* Link a page to an external style sheet
* Create an embedded style sheet on a page
* Apply inline styles to individual page elements

Each method has advantages and disadvantages.

External Style Sheets

Use an external style sheet when you want to apply the same styles consistently across some or all pages in your Web site. By defining styles in one or more external style sheets and linking them to pages, you ensure consistency of appearance throughout those pages. If you decide to change a style, you need to make only one change—in the external style sheet—and the change will be reflected in all pages that are linked to that style sheet. Typically, an external style sheet uses the .css file name extension, such as in Mystyle.css.

An external style sheet might look like this:

body { background: blue;
color: white;
font-family: times, serif;
font-size: 10pt }
a:link { color: red }
a:visited { color: yellow }
h1 { font-family: arial, helvetica, sans-serif;
font-size: 20pt;
font-style: bold }

The HTML code for linking to an external style sheet would look like this:

<head>
<link rel=”stylesheet” type=”text/css” href=”mystyle.css”>
</head>

In addition to using an external style sheet by itself, you can add an imported style sheet. An imported style sheet is a sheet that can be imported to (combined with) another sheet. This allows the creation of one main sheet containing declarations that apply to the whole site and partial sheets containing declarations that apply to specific elements (or documents) that may require additional styling. When you import partial sheets to the main sheet, a number of sources can be combined into one.

To import a style sheet or style sheets, include the @import notation or notations in the style element. The @import notations must come before any other declaration. If more than one sheet is imported, the style sheets will cascade in the order that they are imported. That is, the last imported sheet will override the next to last, etc. If the imported style is in conflict with the rules declared in the main sheet, then the imported style sheet will be overridden.

Here is an example of an external style sheet with an imported style sheet:

<link rel=stylesheet href=”main.css” type=”text/css”>
<style type=”text/css”>
<!–
@import url(http://www.abc.com/style2.css);
@import url(http://www.abc.com/style3.css);
–>
</style>

Embedded Style Sheets

Use an embedded style sheet when you want to define styles only for the current page. An embedded style sheet is a type of cascading style sheet that is “embedded” within the <HTML> tags of a page. Styles in an embedded style sheet can be used only on that page. An embedded style sheet looks like this:

<style>
<!–
body { background: blue;
color: white;
font-family: times, serif;
font-size: 10pt }
a:link { text-decoration: none: }
–>
</style>

Inline Styles

Use inline styles to apply cascading style sheet properties to individual elements on a page. An inline style looks like this:

<p style=”border-style: solid”>
<input size=”20″ style=”text-align: right”>

Note If a page is linked to an external style sheet, the embedded or inline styles that you create for that page will extend or override properties specified in the external style sheet.

Inheritance

HTML documents are structured hierarchically. Style sheets follow this same structure. There is a top-level element (the parent element) followed by child-level elements that can inherit styles from their parent elements—for example, color or size. By letting the children inherit styles from their parents, a default style can be created for top-level elements and their children. The inheritance starts at the parent element and is passed on to its children and then their children, etc.

Inherited styles can be overridden by assigning specific styles to child elements. For example, if a default font size is assigned to the text, all tags related to text (such as bold, italic, etc.) will inherit the default font size assigned to the document. To override the default font size, the child element (bold element, italic element, etc.) must have its own style assigned to it.

For example, the following declaration will, by default, display all text in the document in a 10-point font:

body { font-size: 10pt }

Any formatted text will be based on this parent element, meaning that all text will be displayed in a 10-point font. Adding a style for a child element—in the following example, an h1 element—will override the parent element’s style (a 10-point font) and display the child element in its own style (a 14-point font):

body { font-size: 10pt }
h1 { font-size: 14pt }

All text except for the h1 headings will be displayed in a 10-point font. The h1 headings will be displayed in a 14-point font. If the h1 element contains another element, then that element—for example, the bold (or “b”) element—will also be displayed in a 14-point font. The b element will inherit the property of its parent element, which is h1. If you want to display the b element in some other font, then its own font properties must be declared—for example:

body { font-size: 10pt }
h1 { font-size: 14pt }
b { font-size: 15pt }

The b element will be displayed in a 15-point font. This example assumes that the b element is applied inside the h1 element, and therefore will inherit the h1 element’s properties and not the body element’s properties.

The declaration above will display all b elements in a 15-point font. If you want this specific font to be applied to b elements only if they are inside h1 and not for every occurrence of the b element, then the b element must take a form of a contextual selector:

h1 b { font-size: 15pt }

In the example above, the b element is a contextual selector. It will be displayed in the specified font only if it is found in the context of the h1 element.

Not all properties are inherited. One such property is background. However, because its initial value is transparent, the background of the parent element will be applied by default unless different background value is explicitly set.

It is important to keep the principles of inheritance in mind when creating your external, embedded, or inline styles to ensure that each element appears as you intended.

Creating or Editing a Style Sheet in Microsoft FrontPage

There are several ways to create a style sheet in the Microsoft FrontPage 2002 Web site creation and management tool. FrontPage includes templates that you can use to create external style sheets for a Web site. You can start with a blank template or one that already contains a set of styles (for example, Arcs). When you save the style sheet, FrontPage uses the .css file name extension.

To edit the style sheet, double-click it in the Folder List and the style sheet will open in Normal view. If you want to edit your .css files in something other than FrontPage, such as Notepad or another editing tool, you can associate the .css extension with another program by clicking Tools, Options, and Configure Editors.

You also can create a style for a page using the Style command on the Format menu. FrontPage automatically creates an embedded style sheet (if it doesn’t already exist) and saves the style as a selector within the embedded style sheet.

Note When editing a .css file directly in FrontPage, you can use the Style dialog box to create additional class selectors, modify or delete existing ones, or apply cascading style sheet formatting properties to standard HTML tags such as <h1>. When you click OK to close the dialog box, FrontPage writes the formatting characteristics back to the external or embedded style sheet, using the proper syntax.

When editing a .css file directly in FrontPage, you can use the Style dialog box to create new class selectors, modify or delete existing ones, or apply cascading style sheet formatting properties to standard HTML tags such as <h1>. When you click OK to close the dialog box, FrontPage writes the formatting characteristics back to the external or embedded style sheet, using the proper syntax. Or, you can simply type the style information in proper cascading style sheet syntax. To type style information for an embedded style sheet, click the HTML tab in Page view.

You can also create or edit a cascading style sheet when working with themes. When you choose Format and Theme, and select the Apply Using CSS check box for a theme applied to a Web site, FrontPage creates an external style sheet named Theme1.css (where Theme is the name of the theme) in the root of your Web site. If you modify the theme, FrontPage writes the changes back to Theme1.css automatically. For more information about customizing style sheets in FrontPage themes, download the FrontPage 2002 Software Development Kit.

Using a Style Sheet on a Page

To use the styles in an external cascading style sheet on a page, link the page to the style sheet using the Style Sheet Links command on the Format menu. You can link one or several style sheets to the current page in Page view, the pages selected in the Folder List, or all the pages in your Web site.

If you link a page to an external style sheet in your Web site, the styles in that style sheet can be applied to any element on the page. Styles from a linked external style sheet are displayed in the list of available styles in the Style box.

Linking a Style Sheet to a Page

In Page view, open the page that you want to link to the style sheet.

1. On the Format menu, click Style Sheet Links.
2. In the URL list, select the style sheets that you want to link to the page.
3. Click OK.
4. If you look at the code in HTML view, it will look like this:

<link rel=”stylesheet” type=”text/css” href=”sitestyle.css”>

Tips

* If the URL list does not contain any style sheets, click Add. In the Select Style Sheet dialog box, browse to the style sheet that you want to add to the list and then click OK.
* To link all the pages in your Web site to the selected style sheets in the URL list, select All Pages.
* To remove a style sheet from the URL list, select it and click Remove.
* To change the cascading order of the style sheets in the URL list, select the style sheet that you want to move and then click Move Up or Move Down.

Note The URL list is the order in which the style sheets will cascade, so be certain that the order you see is the order in which you want your style sheets to cascade.

Caution If you select All Pages in the Link Style Sheet dialog box, FrontPage will erase all style sheets that are on your pages and replace them with the new style sheet choices that you have selected. This can be a quick way to apply new styles to your entire Web site but can cause problems if you didn’t intend to remove existing style sheets.

The Style box lists standard HTML tags such as heading 1, as well as any class or id selectors contained in an embedded style sheet or external style sheet linked to the page.
Appling a Style to a Page Element

1. Select the desired page element.
2. On the Format menu, click Style.
3. In the Styles box, choose the desired style or selector.
4. Click OK to apply that style.

In FrontPage, some formatting features are automatically applied as inline styles. For example, if you apply a box around a normal paragraph using the Borders and Shading command on the Format menu, FrontPage writes the formatting information as an inline style attribute for the paragraph tag (for example, <p style=”border-style: solid”>). Some attributes will be applied using cascading style sheets, while others will use HTML. If you want to apply inline styles using only cascading style sheets, apply a class or ID selector or an inline style using the Style button from the Format menu.

FrontPage allows you to quickly apply inline styles for the following options (all found on the Format menu):

* Font. This menu item contains some font effects on the Font tab and expanded or condensed spacing on the Character Spacing tab.
* Paragraph. This menus item contains indentation and spacing options.
* Borders and Shading. This menus item contains all border and shading options.
* Position. This menus item contains all positioning options.

If a style feature is unavailable (dimmed) from the Format menu or if you do not want to use cascading style sheets in order to ensure compatibility with older 3.x browsers, then you need to enable or disable specific levels of cascading style sheets. To enable or disable cascading style sheets:

1. On the Tools menu, click Page Options.
2. Click the Compatibility tab.
3. Check or uncheck CSS 1.0 and/or CSS 2.0 to enable or disable the associated level of cascading style sheet.

Creating a Custom Scroll Bar Using Cascading Style Sheets

As newer versions of browsers become available, Web site designers will find even more features of the cascading style sheet specification that they can use on their Web sites. For example, Microsoft Internet Explorer version 5 added a new ability to customize and add colors to the scroll bars on a Web site. An example might look like this:

body {
scrollbar-arrow-color: #6C000E;
scrollbar-base-color: #1D50AC;
scrollbar-dark-shadow-color: #1D50AC;
scrollbar-track-color: #2559AF;
scrollbar-face-color: #FFCC66;
scrollbar-shadow-color: #000000;
scrollbar-highlight-color: #D9D9D9;
scrollbar-3d-light-color: #FFCC66;
}

You can enter the colors using Web-safe color values as represented by regular color names (such as green, black, and red), hexadecimal values (such as #008000, #000000, or #FF0000″), or RGB values. Note that some older browsers may not support color names.

For help in creating style sheets for your own custom scroll bar, you can go to EchoEcho.Com and use the Custom Scrollbar tool to create the code that you need to put into your Web pages’ <HEAD> section. Note that the custom scrollbar works only in Internet Explorer 5 or later.

Using Style Sheets for Specialized Browsers and Output Devices

When cascading style sheets were introduced in late 1996, they represented an exciting new opportunity. They enabled much more sophisticated page design (typography and layout) than Web site developers had been used to, and they also greatly simplified the process of making Web pages accessible to as many readers as possible, regardless of the device that they use to read a page and regardless of any disability they might have.

By using cascading style sheets, you can separate the content of an HTML document from the information about its presentation or style. This allows you to apply precise formatting and achieve the desired layout without using HTML code in a way that might confuse screen readers and specialized browser software.

An important assumption underlying the CSS1 recommendation was that Web pages were viewed using a personal computer with a monitor. But there are many more ways to access a Web page. And each of these different media has its own characteristics. It may be a small device with a monochrome display. It may be aural, reading Web page content aloud. It may be television-based, like the WebTV® service. Looking toward the future, we really have no idea what new Web access methods will be like.

CSS2 provides a way to tailor a style sheet to the particular medium that is being used to display a page. Inside a single style sheet, you can have different declarations for printers, handheld devices, monitors, etc. Additionally, different style sheets can be imported depending on the medium used for browsing. An example of using a specialized declaration for an output device is the @media rule.

The @media rule is a subset of a style sheet specific to a particular type of medium or group of media. An @media rule specifies the medium or media to which it applies, and contains a number of statements exactly like the statements we usually find in a style sheet. These statements apply only when a Web page associated with this style sheet is being displayed using one of the media to which the @media rule applies.

@media rules are straightforward to construct. They are made up of:

* The keyword @media
* A list of media types, separated by commas
* The statements to be applied to this group of media, contained inside curly braces ({})

For example, the following rule applies a white background and black text color to the body of page when it is being printed or displayed on a handheld device:

@media print, handheld { background: white; color: black }

In designing a Web site for different devices and accessibility, the CSS2 recommendation provides for the following media types:

all
Suitable for all devices.

aural
Intended for speech synthesizers.

braille
Intended for Braille tactile feedback devices.

embossed
Intended for paged Braille printers.

handheld
Intended for handheld devices (small screen, monochrome, limited bandwidth).

print
Intended for paged opaque material and for documents viewed on screen in Print Preview mode.

projection
Intended for projected presentations (for example, projectors or printing to transparencies).

screen
Intended primarily for color computer screens.

tty
Intended for media using a fixed-pitch character grid, such as teletypes, terminals, or portable devices with limited display capabilities (authors should not use pixel units with the tty media type).

tv
Intended for television-type devices (low resolution, color, limited scrollability).

Although the @media rule provided above as an example is a simple one, it illustrates how easily cascading style sheets can be used to start making your site more accessible. So if you have been putting off accessibility improvements for your Web site, think of this as an opportunity and not an obstacle. To learn more about cascading style sheets and accessibility, check out the Web Accessibility Initiative (WAI) from the World Wide Web Consortium. W3C provides links to more than 30 accessibility evaluation tools and free Web-based validation services for both HTML and cascading style sheets.
Conclusion

Adding cascading style sheets to your Microsoft FrontPage Web site offers you a great deal of flexibility in the look and design of your layout. Embedded style sheets allow you to alter the elements of particular pages. By using an external style sheet, you can quickly update the look of your entire Web site or make your site more universally accessible.

Also, a site based on cascading style sheets is much easier to manage than an HTML-only site. Style changes made to a .css file are applied throughout the site without the need to alter any of the site’s HTML files. Using cascading style sheets also reduces the overall size of each HTML file, because all the style information is stored in the .css file.


« Previous PageNext Page »

 
Indelv.com is for sale!
 
ERP systemen
Alle ERP-systemen op een rij, compleet met ERP-nieuws en ERP-software informatie.
www.ERPcentraal.nl
ERP systemen
Alle ERP-systemen op een rij.
www.erpmatrix.nl


Quick Links
Our Friends
Cool Places
Visit also
About Us