Search DominoPower's 11,437 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
Keep lookin' good with Cascading Style Sheets (continued)

You can include as many rules as you want in between the <STYLE> tags.

You can find the style declaration attributes and values for Microsoft Internet Explorer at http://msdn.microsoft.com/library/default.asp?url=/workshop/author/css/reference/attributes.asp.

Using CLASS and ID to reference selectors
Okay, so now we've got some embedded CSS rules and they have selectors. How do we use the rules?

It's easy. The only thing you need to do is add a CLASS or ID attribute to the HTML page element that you want to apply the rules to. If you're going to use CLASS to reference CSS rule selectors, then the rule inside the <STYLE> tags must be prefixed with a full stop. Have another look at the example above and you'll notice that in the style sheet, "myrule" is prefixed with a full stop. Similarly, using ID to reference CSS rule selectors requires that the rule inside the <STYLE> tags must be prefixed with the "#" symbol.

The last two rows of the above example show how to use CLASS and ID to reference the rule selectors in the style sheet. The example includes two <p> elements, one using CLASS to refer to a selector and one using ID to refer to a selector.

Easy, isn't it?

Linked CSS
So far we've seen that inline CSS gives you fine control over individual page elements. Embedded CSS allows you to make global changes across an entire HTML page.

Linked CSS goes one step further and stores the style sheet outside the HTML page. This means that multiple HTML pages can refer to the same linked CSS file. Thus you can make changes in a single location, and those changes will apply to all of the HTML pages that use that linked CSS file.

I've separated the style sheet rules from our example into a file. This will be our linked style sheet. For your convenience, I've stored the linked style sheet on my Web server at http://www.touchdown.com.au/dpmay2002.css. These are the contents of the linked style sheet:

.myrule {
font: 23px Verdana, Geneva, Arial, Helvetica, sans-serif;
color : green;
font-weight:bold }
#anotherrule {
font: 50pt Arial, Helvetica, sans-serif;
color : purple;
font-weight:italic }

Okay, now that we have a linked style sheet available, load the following into a Web browser, and you'll see how easy it is to get linked CSS working for you.

<head>
<link rel='stylesheet' type='text/css' href='http://www.touchdown.com.au/dpmay2002.css'>
</head>

<p class='myrule'>the first test</p>
<p id='anotherrule'>another test</p>

Conclusion
Cascading Style Sheets is one of my favorite standards/technologies. Style sheets are very simple to understand and implement, and give excellent results.

The results you get from using Cascading Style Sheets easily outweigh the effort that you need to put in (which is, effectively, none).

Take a little time to explore the CSS reference guides and your software will look better and cleaner and you'll be able to add that cool factor without the need for graphic designers, time, or cost.


« Previous  ·  1  ·  2  ·  3  ·  Next »
Other articles you might like
Home > Internet Technologies > HTML and CSS (15 articles)
   Using a reusable code approach to HTML select option lists
   One reader's opinion on HTML mailing
   Cascading Style Sheets make you look good
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
Adding Quick Highlighter support to IBM Lotus Notes Domino Wiki, Weblog, or Webpage
Remember Young Admins...there are 2 files
WebSphere Portal 6.1.0.2 and Lotus Domino 8.5
The CKEditor - with Domino
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- Advertisement --

Find unused Lotus Notes groups and clean up your address book
Have you ever wanted to get rid of old Lotus Notes groups that were cluttering up your address book, but you weren't sure if they were used? Find Unused Groups can help.

Find Unused Groups will check your ACL, mail, multi purpose and server groups to help you determine if they are used, and who uses them.

Learn how to easily clean up your address book.

-- Advertisement --

Teamstudio Edition 25 has shipped
It's finally here! Now that Teamstudio Edition 25 has shipped, listen to our latest Tool Time audio program to find out what's changed. Updates to all your favorite Teamstudio tools will be discussed.

Plus, you'll get an introduction to Teamstudio Undo (formerly known as Teamstudio Snapper).

Tap here to get started!

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login