India Design Services  
 
Welcome, anonymous (Log in)   RSS Newsfeed
Fixing Common Java Errors
Posted by IDS Admin   •   Thursday, 2008-March-20
By: Ashwak Sarhan

Whether you are just starting your first Java program, or you are a well experienced programmer, your code can not be an error free code and compile successfully from the first time. At the least you may confuse variable names, forget to declare a variable, or miss a semicolon.

Java language errors, just like all other programming languages, can be either syntax errors or logical errors. Syntax errors, also called compile time errors, are illegal use of statements in terms of programming language rules. When the compiler catches them it generates an error message indicating the class name, line number where the error is found, and the type of error. However, sometimes the actual error may not actually be in the line indicated in the message. You would want to look in and somewhere before these lines to locate the error.

This happens because syntax errors can be tricky sometimes; one error may lead to more than one error message. A missing semicolon for example causes the following one or more lines to be invalid, and thus generates error messages for all of them. Once you fix that error, all following messages will be cleared.

When writing a program with Java, syntax errors are almost unavoidable, so do not panic or get disappointed when you encounter them. Some of these errors are very common and you are very likely to encounter one or more of them when compiling your code. The fact is, you cannot avoid them. So the best way to deal with them is to get yourself familiar with them and know how to fix them. Below are some of the most common errors along with their solutions.

Capitalization Errors: Java language is case sensitive, variable names must be exactly the same, Total is not the same as total and not the same as toTal.

The file name is different than the public class name: The class should be saved in a file with exactly the same name; a Shirt class should be saved in a file named Shirt.java. Saving it to a different file name will give a compiling error.

Javac cannot find the class: When you save your classes, or source codes, they have to be in the very same directory where your javac.exe is. This file is responsible for compiling your codes and is created automatically when you download and successfully install the DSK machine. Generally you would install the SDK into your C: drive so there where your javac file will reside. Thus when saving your source code you need to save it in the C: directory in a folder named java.

"javac is not recognized as an internal or external command, operable program or batch file" (for Windows System) or "javac: Command not found" (for UNIX System): This means that your compiler cannot find your javac. This is due to one of two reasons, either you do not have a javac at all because you did not install the correct machine, or you did not set your PATH correctly. In this case you need to properly set your PATH, or you will have to type in the full file name path to execute it.

"Exception in thread "main"

java.lang.NoClassFoundError: 'fileName': You probably misspelled the fileName, remember that java is case sensitive.

"Line nn: ';' expected": This means you moved to a new line without signaling to the compiler. When your string, or code line, is too long to fit in one line, you may want to split into two lines. Doing that just by pressing the Enter key will confuse the compiler and generate an error. Instead you will need to concatenate with a '+' sign. That is split your string into two lines, ending the first with a '+' before moving to the second line.

Author Bio

Ashwak Sarhan is a Java tutor for Baker College Online.

Article Source: http://www.ArticleGeek.com - Free Website Content
Web Site Design and Choosing the Right Web Design Company
Posted by IDS Admin   •   Thursday, 2008-March-20
By: Shawn M Hickman

It's been several years since you had someone design your company web site and now it's outdated. You are losing business to competitors that have quality designed web sites with great layout and navigation. This may be your first company web site and you want to make the most of your money and time.

How do you choose a quality web design company that will understand your companies' objective for designing or redesigning this web site?

First, you need to answer a few questions.

1. What is your budget and time frame for completing the web design or redesign project?

2. Are you going to be using original content and pictures for building this web site?

3. If this is a website redesign, are you planning on getting updated images and content for this new look and layout or will you need the web design company to supply them for you?

4. Does any one at your company have basic editing skills and will they be able to update the website content or will this be an ongoing job for the web design company you hire?

5. Are you looking for a local web design company?

6. Do you already have an idea of your web design colors, layout, and navigation?

Knowing the answers to these questions, will help you when you locate the right web design company.

Now it's time to find the right web design company for your needs. Go to Google and search for local web design firms and you will see how many results show. Take "web design orlando" for example: Results 8,860,000. Wow, there are a lot of results for "web design orlando".

Don't panic, you will probably find a company that can do the quality web design work you need in the first 50 results. Quality web design firms will have a portfolio of work online that will show an example of their custom web design work. Start at the first web design result on work your way down.

Examine the portfolio to see if there is anything equivalent to the web design layout you are imagining. You will be able to tell immediately if this web design firm is right for your company and its look and feel. Find out how long they have been in the web design industry and compare that to how many quality web sites they have designed in that time.

If this is a redesign, find out how many web site redesigns that have completed and ask to see the web site before and after the redesign.

Find out if they have the staff available to work on your entire web design needs and that they know the programming necessary to complete the job in a timely manner. Ask for references, a top end web design firm will be glad to offer up references on the web design work performed. Most web design references will be glad to talk to you about the quality job your potential web design company did on their web site.

Depending on your web design budget, it may help to several quality web design companies to talk to. You will want to get at least 3 estimates and it never hurts to have

more.

Remember, when it comes to your business and your companies exposure on internet, take you time locating a quality web design company. Your future may depend on it.

Author Bio By Shawn Hickman - Internet Marketing Manager

source: Web Solutions of America

Article Source: http://www.ArticleGeek.com - Free Website Content
You Can't Have My Money!
Posted by IDS Admin   •   Thursday, 2008-March-20
http://www.ArticleGeek.comBy: WebDevelopmentQuote.com: Article Source: - Free Website Content

If you are a business and expect to be taken seriously on the Internet, you need to shape up and project a professional image.

Please don't think this is a request. This is a demand from the Ritalin-popping-immediate gratification-generation surfing the net (aka 95% of your potential customers).

I want to give you my money...

I want your products...

I want to trust you...

but, I'm afraid that is impossible now that I have seen your website.

Flashing sunshine and rainbows are pretty. As a matter of fact some of my most pleasant childhood memories involve sunshine and rainbows. Also, multi-colored colored text exclaiming "Welcome to my HoMe PaGe on the world-wide internetz!" makes me all warm and fuzzy inside.

Will you be my friend?

No, scratch that, I just threw up in my mouth a little bit, but somehow I'll get through this. "GULP"

I have put the sunshine and rainbows behind me and just as I am about to send my payment to you at "LetsGetItOn6969@example.com", I think... Can I trust someone who uses an email address like that for their business transactions? Sure, my email address may be "EatinBaconNaked@whatever" but I am the customer, I can do that. Please for the love of all that is holy, just get an email address appropriate for business that is separate from your personal email.

And those animated icons that you send in your email, you know, the ones that make Outlook crash like it's coming down off a Pop-tart induced sugar high? Yeah those, keep em' coming.

Oh, and since I am your customer now, you have my permission to include me on your CC list of "friends" because I want to be in your life. OMG PONIES!!! ARE SOOOOOOOOO CUTE!!!

ROFL.

While I'm on the subject, please learn the English language. I can't seem to find a "Childish - to - English" translator on the web. So, for the remainder of our business transaction I am going to have to ask you to speak and write a language with actual words. Sure, I "LOL" all the time but really, when is the last time you seen anyone "ROFL" or "ROFLMAO". Certainly, I would never "LMAO" when talking to one of my customers, but maybe I am just getting old...

BRB, I have to TMGARTF (Take my Geritol and read the funnies).

By the way, I enjoyed listening to the midi background music while I was browsing your website. Nothing gives me more confidence in you as a respectable business than an endlessly looping midi version of Metallica's Enter Sandman.

FYI: Midis were cool for about three days in early 1994, and you missed the boat.

You should also know, some of the pages on your website won't load in my browser. Is it possible that those pages don't exist? Wait, what does that little sign say... "Please Excuse The Mess, This Website is Under Construction". Don't worry, I won't mind the mess while your website is eternally under construction, I live in Michigan, I'm used to construction. I am also used to reading "Comic Sans" font in 48 pt type on an endlessly repeating 220 KB JPG background of clouds. That's just what we do for fun here in Michigan in the two weeks every year when there are no beer tents to be found. We throw a little "Dom Casual" on some animated shooting stars when we want to mix it up a bit.

I remember how proud I was in explaining to girls how Netscape 3 was the first to support frames and how it was clearly superior to Internet Explorer. I died a little bit on the inside today when I somehow managed to find your website ...and yes I was a lonely nerd, shut up.

Jeeeeeeeeeeeeeez...

FYI: Frames are generally considered a bad idea for more than a few reasons.

Accessibility - Frames are a nightmare for screen readers used by the visually impaired; however I suspect in the case of your website, they are the fortunate ones.

Search Engine Indexing - Search engines will want to index your pages that actually have text content, however, because of the frameset, your content pages probably don't have any navigation links, thereby leading unlucky visitors in to sub-pages with no navigation.

Ah, but I forgot... you're the "professional". Let's just make a flash intro page with a huge animation with little or no relevancy to your industry and a big link that says "CLICK HERE TO ENTER". I guess that just fixes everything now doesn't it? Better yet, why don't you skip the enter link so we have to sit through your entire flash intro, that's how to really impress your customers. Now, tell me, why doesn't your website show up in the search engines? Must be some kind of conspiracy, yeah...

Is something following my cursor or is it my inner ninja just anticipating it's every move? Scary.

I know there is a ninja/pirate joke in there somewhere but I'm too distracted by all the pretty colors.

Yes! I would like to set your website as my home page, thanks for reminding me! And, I would "Send this page to a Friend", but all my friends are IRL (in real life).

Now, what was it you were selling?

Oh, I see, you're a web developer. Well, isn't everyone?

No, it's all right, I'm not crying. I'm just allergic to Geocities.
Characteristics of a Properly Designed Website
Posted by IDS Admin   •   Saturday, 2008-March-15
Continued from chapter one

A properly designed website can be defined as a user-friendly, search-friendly, and persuasive site that converts visitors to customers.

Chapter Two:

If your website is properly designed, it will automatically be optimized for search engines. While your website is still in the concept stage, take care to separate textual elements from design elements. Although the information that is on your website will bring the visitor, it is the actual design that makes an impression. A website that is poorly laid out and hard to use will not attract and keep visitors no matter how wonderful the information is.

Choose your layout, colors, style and information based on the characteristics of your target customer base. If your customer base is state-of the art engineers, you can utilize the latest bells and whistles to give your customers an eye-popping experience. If your customer base is a little more average, or if you aren't sure, design for the most common browser and resolution. Then check your page in the site viewer at Anybrowser.com and make any changes necessary. Don't neglect your customers with special needs. Designing for people with disabilities makes the user experience easier for everyone. See Designing sites for universal access for tips.

Your home page should have at least 275 words of text that describes your product and entices your customer to look through your site. Your first paragraphs (80 lines or so) are the most important and should include your primary keywords and your tagline with a call to action. Your primary and secondary keywords should be about 5% of the text on your home page, used in complete and logical sentences. Please note: It does not appear that search engines are reading or following the information contained in iframes.

Free Keyword Density Analyzer

enter URL-1:

Enter URL-2:

Enter Keyword or Keyphrase:

Case Sensitive:

Structure this information so that your primary keywords are compelling headlines in tags and your secondary keywords are subsequent selling headlines in tags. Make your text easy to read. Use lots of white space and bullet information where appropriate.

Every graphic should have an alt tag that accurately describes the graphic using the keyword. Do not put keywords in the same color as the background text! This is keyword stuffing and you will be penalized for it.

Remember, first impressions count. Make the first page of your website one that clearly explains who you are, where you are, and what you can offer your visitors. Give them a reason to have confidence in you. If you are an expert on something, state your qualifications up front.

Don't use a splash page, or design your site entirely in Flash. Besides eliminating customers who may not have the necessary software to view your site, this type of design provides no clues to search engine bots. Don't use a framed site for the same reason. Take a hard look at your home page. It is professional in appearance and attractive to your target audience? Are the graphics memorable, enhancing the value of your site? Is the navigation intuitive?

Homework: read your home page out loud. Does it read easily and naturally? Does it entice readers to keep looking through your site? If not, go back and tweak your text. Don't skip this step!
Do some web pages look strange to you? Find out why!
Posted by IDS Admin   •   Saturday, 2008-March-15
In an effort to make "surfing the net" more enjoyable, some companies have created programs which have actually made it worse. If you notice a lot of blank space on the sites you visit, sentences that seem to be missing words, words that are highlighted in yellow or bronze, links that don't work or take you to blank pages (etc), it may not be the fault of the site you're visiting. You may hear the term "spyware" associated with this problem, although there are other products that may cause these problems.

One of the most common is Norton Internet Security and Norton Personal Firewall. It installs with the Ad Blocking feature turned on, which might be a fine feature if computers weren't so dumb:-)) Unfortunately, there is no way to clearly identify an ad so the software blocks whatever it believes might be an ad. This is a bit like chopping off someone's hand to remove a hangnail. It works, but wouldn't you rather have your hand? It also blocks certain picture sizes, those most commonly used by ads. If a picture that you want to see just happens to be the same size, you will only see a blank space. To fix this, just disable the Ad Blocking in Norton Internet Security. (Zone Alarm, Symantec, F-Prot AntiVirus and Webwasher will also block ads and popups, but you have to choose that option.)

Other programs that may interfere with your web viewing are programs commonly referred to as spyware, like Gator/GAIN, Hotbar, MySearch, etc. These programs and toolbars will fill in forms for you and keep track of passwords, which is a nice feature, but you should be aware that whatever information you put in is at risk. These programs run in the background all the time, using up system resources, slowing everything down and occasionally causing your browser to crash. (They also may add icons to your desktop, change your browser settings and home page and won't allow you to change them back or add themselves to your favorites list permanently.)

They do this so they can collect information about you, what applications you use, how often you access the Internet, where you go while you are there and so on. They use this information to customize your shopping experience i.e. serving you appropriate pop-up ads or unsolicited E-mails (AKA sp*m) for items you might wish to purchase. They also can do a nasty thing to website owners - they change the affiliate code on any advertising to their code. In other words, if your favorite site depends on income from Amazon sales to survive, they are not going to get that commission if the buyer has spyware such as SaveNow installed.Where does spyware come from? If you share music files or photos with other users through Kazaa, Grokster or other sharing sites, download freeware/shareware applications or games using Download Accelerator Plus, FlashGet, Gozilla or NetAnts or share your computer with other users who might not be as cautious as you, you are at risk for getting caught by spyware. It downloads with the most innocuous programs (ever choose a comet cursor?), sometimes even when you don't want it to. (Ever accidentally click on a "yes" button when you meant to click on something else?)

For future prevention, make sure software cannot just download on your computer without your permission. From the Internet Toolbar, go to Tools > Internet Options > Advanced. Make sure all options "Enable Install On Demand...." are unchecked.

Some spyware uses "driveby downloading" which takes advantage of the Internet Explorer's ActiveX meant for easier viewing of flash sites. For more on increasing your security levels to prevent this, visit Thiefware.com.

How do you get rid of spyware? Click on your start button and you should see "settings" as one of the options. Click on this, then open your 'Control Panel' and click on 'Add/Remove Programs'. Find the spyware in the list of programs, highlight it, click 'Change/Remove' and follow the prompts to uninstall it. Look for names like Gator, Offer Companion, SaveNow, Hotbar, Kazaa,eZula, Radiate, MySearch. There is a list at Spychecker. Be aware that the spyware-supported applications will most likely not work after you have removed them. They should also be uninstalled as well.

Then run a spyware utility program like Spybot or Bullet Proof Software to make sure you removed everything. New ones are constantly being invented! Spyblaster may help prevent their download. You don't need to download a spyware program to use a program to fill forms, save passwords or download music. For a list of safe alternatives, visit Safer- Networking, Spyware Info, Roboform, and Google.

Windows users: After you are all done, run a scandisk and a defrag. Use EasyCleaner to clean your registry. Your computer will thank you for it!

http://www.phoebemoon.com/fixing.htm
Using Style Sheets
Posted by IDS Admin   •   Saturday, 2008-March-15
Notice anything different?

With a click of the mouse, the background color and the fonts used in the headings was changed. This page uses an embedded style sheet, placed in the head of this page only. However, an external style sheet should be used if the style is to be applied to numerous pages. With an external style sheet, the web designer can change the look of an entire site by simply changing one file. To use an external style sheet, create a blank document with the ending .css. It should NOT have any HTML markup. In the example below, it is named style.css. Then place a link in the head of your HTML document, like this:

The rel attribute is set at the value "stylesheet" so the browser will recognize that the href attribute is giving the URL for your style sheet. In this example:

the optional TYPE attribute is used to specify a media type (text/css) giving browsers the opportunity to ignore style sheet types they do not support. The MEDIA attribute is also optional. This specifies the media to which the style sheet should be applied. Possible values are:

screen (the default value), for presentation on non-paged computer screens;

print, for output to a printer;

projection, for projected presentations;

aural, for speech synthesizers;

braille, for presentation on braille tactile feedback devices; for character cell displays (using a fixed-pitch font); and

tv, for televisions; all, for all output devices.)

Since Netscape has difficulty with declared MEDIA styles, it is best to not to specify MEDIA unless the value will be other than screen. Another browser quirk is that Internet Explorer 3 for Windows 95/NT4 does not support BODY background images or colors from linked style sheets so an alternative for these rules should be specified. Use an an embedded style sheet (an individual style sheet for that page only), or use the BACKGROUND attribute of the BODY element like so:

To embed a style sheet on an individual page, place the STYLE element in the document HEAD. To avoid having older browsers mistake the STYLE element as text and displaying it, enclose it in comment tags. (With a linked stylesheet, you don't have to use comment tags.)

If you are using an External Style Sheet, but would like to change just one element on just one page, you can use an Inline CSS styles. Inline Styles are inserted into the HTML code, not the HEAD and affects only the element specified.. For example: your external style sheet has your font set to 12 px Verdana but you would like a particular paragraph to be set to 16px Times New Roman. The code you would use would look like this:

12 px Verdana text

16px Times New Roman text

12 px Verdana text

What else can you do with CSS?

You can set Font Properties, such as font family (which font will display), font style (italics), font variant (large or small letters), font weight (bold) and font size. Let’s look at this example of embedded STYLE.



What’s going on here? You should have recognized the and the . The rest of the Style Sheet specifies font faces, sizes, and leading, which is the vertical space in between lines of text.

The first line gives information about the BODY of your web page. Your top margin will be flush against the top (margin-top: 0), and the default font will be Verdana. If Verdana is not available on your visitors browser, the font will be helvetica or, failing that, geneva or any generic sans-serif font.

The second line gives information about the four types of links found in a web page.

A:link is an unvisited link,

A:visited is a visited link,

A:active is an active link and

A:hover is a link with a cursor over it. Please note: A:hover must be the very last one in this selection to work properly

Text-decoration none means the link will not be underlined, and font weight bold means the link will be presented in bold text. Note that we later on define the color of bold text with

B { color: #333399 }

Other possible values are shown below. Beware: not all of them are supported by all browsers.

B { text-decoration: underline }

B { text-decoration: overline }

B { text-decoration: line-through }

B { text-decoration: blink }

B { font-style: italic }

B { text-transform: uppercase }

A link with the cursor hovering over it will be shown in color #fffcc, a HEX HTML color code This is assuming you are not using Netscape 4 which does not support a:visited or a:hover.

ROLLOVER COLOR TEXT LINKS

Have your text links look red when the mouse passes over them by inserting this code into the HEAD of your document:

LINKS WITH NO UNDERLINE

The latest fad to hit the web. Remove the underline from any or all of the links on your page by putting this in the HEAD of your document:

LINKS WITH A LINE ABOVE AND BELOW THEM

Fun to use with hover.

If you put your link in a table, the style below will highlight the whole cell.

The next four rules give definitions for the headings. H1 will be shown in bold, 32 pixel Verdana with 10 pixels above it (margin-top) and 2 pixels below it. (margin-bottom). The P declaration sets the line height at 150%. This refers to the spacing between lines. In this case, the leading will be one and a half times the height of the font. But where is the FONT size specified?

There are a number of options for specifying FONT size, each with its good points and bad points. The problem is major browsers show FONT sizes differently. In old style browsers, FONT SIZE=3 is the default size, defined as medium. Netscape assumes FONT SIZE=3 unless you specify another size. Unfortunately, in the IE/Windows scheme, FONT SIZE=3 is small instead of medium. Even modern browsers can't solve this problem as both Mac and Windows define "medium" differently. (Medium on a PC is roughly 1/3 larger than medium on a Mac.) If font size is left unspecified the visitor can easily change the size by adjusting the LARGER/SMALLER type buttons in current versions of Explorer and Navigator.

Some designers try to get around this by using one of the seven absolute sizes:

xx-small

x-small

medium

large

x-large

xx-large

These sizes allow the designer to choose the size of the text relative to the font size the user has specified. The problem with this, however, is that Netscape 4 largely ignores them. Netscape 4.5 and higher and IE3 render xx-small and x-small so itsy bitsy that no one can read them.

Another option is points, although points are a unit of print, not a unit of screen space as are pixels. Points are commonly used in word processing packages, e.g. 12pt text. Setting font size in points has the same disadvantages as pixels, but has the advantage of being printer friendly. Macs display point sizes the way point sizes actually look in print; Windows displays point sizes too large. By using pixels, you're forcing the systems to display type at the same size whatever browser is being used.

Fonts specified in pixels, as we have done in the example above, will be the same size across platforms but not necessarily the same size from computer to computer because of monitor resolution. In addition, fonts specified in pixels cannot be adjusted by the user, which may make the text difficult to read for some visitors. Added to the fact that some printers don't interpret pixel size properly, and you come to the last option: ems.

The size of an em is determined by the user. An em is a unit of distance equal to the point size of a font. For example, in 14-point type, an em is 14pts wide. By using em's you can preserve the general look of the Web page independently of the font size. This is a safer alternatives than pixels or points, which can cause problems for users who need large fonts to read the text. Unless your visitor is using Netscape 4 or IE3. Netscape 4 ignores em's and IE3 misinterprets them as as pixels.

Another way to set font that makes it easier for your visitor to resize text in their browser is to use percentages instead of absolute sizes. For example, instead of using 10pt, use 83%. Here is an easy chart for your use:

6 pt 50% 12 pt 100%

7 pt 58% 14 pt 117%

8 pt 67% 16 pt 133%

9 pt 75% 18 pt 150 %

10 pt 83% 20 pt 167%

11 pt 92% 22 pt 183%

One problem with this type of specification is that these sizes are "inherited". More information is on the next page.

lease note: If you define font-family before color, Netscape will not recognize it. Here is the way it should look:

body, td {

color: #003366; font-

family:Verdana,Geneva,Arial,Helvetica,sans-serif;

font-size:13px;

margin:2px 0px 5px 0px;

padding:0px 0px 0px 0px;

background: #FFFFFF;}

http://www.phoebemoon.com/css2.htmhttp://www.phoebemoon.com/css2.htm
An introduction to CSS
Posted by IDS Admin   •   Saturday, 2008-March-15
designing with style!

Is you grumble through the third change in all the pages of your website, have you ever wished for a better way? Well, CSS (Cascading Style Sheets, also known as Style) just might be it. Style sheets are a method of setting up the presentation - or style - of your site independently of the content. This ensures that your site design is consistent throughout, and makes it easier to make changes in the website as a whole. Style sheets make the the HTML of the individual page smaller as a style definition can be established once and applied to the whole website, thus improving load time. In addition, most browsers will cache an external style sheet, allowing the visitor to view additional pages in the site faster. It can also be applied to just a single page.

A style sheet is made up of style rules that tell a browser how your document should look. For example, a style sheet can establish the background color, the font and the margins of your web pages. The STYLE element is placed in the HEAD of your documents HTML code. To do this, you can use traditional HTML syntax or invent your own classes. The STYLE element can contain the style rules for a single page, or refer to an external style sheet for use in more than one page. An external style sheet will always end in .css.

Not all browsers support CSS, and those that do may not support all aspects of style sheets. (Click here for a chart.) Generally, CSS is ignored by older browsers. If a particular element is important to the appearance of your web page, be sure to specify an alternative method to CSS. When testing your style sheets, always check Netscape 4 first since that seems to be the browser with the most difficulty interpreting CSS.

Style sheets look pretty intimidating when you first see them. However, once you understand what is going on, they become easy to read and easier to use. Here is a portion of the style sheet used on this page:

CSS Example body { font-family: Verdana, Geneva, Arial, Hevetica, sans-serif background-color: #C8FFFF; color: #582480; } text text

What’s going on here? A style sheet starts with a selector (usually an HTML element such as BODY, P, H2 or EM) and the style to be applied to it. In the above example, the HTML element BODY is the selector. There are any number of properties that can be applied to this selector. In this example, they are: { font-family: Verdana, Geneva, Arial, Hevetica, sans-serif background-color: #C8FFFF; color: #582480; }

A property (such as font-family) and a corresponding value (such as Verdana) is called a declaration. Several declarations for a single selector is called a declaration block. Multiple style declarations for a single selector are separated by a semicolon as shown above. A selector plus its declaration block enclosed in curly brackets is called a rule (or rule-set.) The declaration block above is the declaration block for the selector BODY. A block always begins and ends with a curly brace. If the declaration block above had the word BODY above it, it would be a rule.

In the above declaration block, the font of the web page using this style will be Verdana. If Verdana is not available on the viewers browser, Times New Roman will be used. The background color of this page will be #C8FFFF and the text will be #582480. You can choose your colors from the decimal RGB color codes which are considered browser safe and generally show the same across platforms.

Another selector possibility are the header tags. These are the tags that indicate the size and importance of a heading. Headings are preferable to larger fonts, as they are often used by search engines to identify the importance of a topic on a page. Screen reader software will give it the proper emphasis as well.

Here is the rule for the headers on this page: h1, h2, h3, h4 { font-family: Bookman Old Style, Times New Roman, Times; } h1 { color: rgb(51,51,204); } h2 { color: rgb(0,153,51); } h3 { color: rgb(204,51,51); } h4 { color: rgb(51,0,204); }

From this rule, you can see that the heading tags will be in the Bookman Old Style font or, failing that, Times New Roman and will be colored as defined.

H1 H2 H3 H4

Say you wanted three different selectors to have the same value. You could show it like this:

H1, P, BLOCKQUOTE { font-family:verdana }

This rule specifies that all text within , , and
tags will display in the verdana font.

What else can be defined?

Font Properties, such as font family, font style, font variant, font weight and font size

Color and Background Properties, such as Background Color, Background Image, Background Repeat, Background Attachment and Background Position

Text Properties such as Word Spacing, Letter Spacing, Text Decoration, Vertical Alignment, Text Transformation, Text Alignment, Text Indentation, Line Height

Box Properties, such as Top Margin, Right Margin, Bottom Margin, Left Margin, Top Padding, Right Padding, Bottom Padding, Left Padding, Padding, Top Border Width, Right Border Width, Bottom Border Width, Left Border Width, Border Width, Border Color, Border Style, Top Border, Right Border, Bottom Border, Left Border, Border, Width, Height, Float, Clear

Classification Properties such as Display, White space, List Style Type, List Style Image, List Style Position, List Style

Units such as Length Units, Percentage Units, Color Units, URLs

http://www.phoebemoon.com/css.htm
Previous page | Next page
<August>  <2008>
SUMOTUWETRFRSA
     12
3456789
10111213141516
17181920212223
24252627282930
31      

Archive

March,2008 [11]
February,2008 [22]

Search