How to Use CSS in Handhelds

Today we will concentrate on handhelds, since after normal desktop and laptop browsers, handhelds are the most common in use. However, these principles apply to all media types, with the exception of screen.

There is no rule that says you have to create a stylesheet for handhelds. In fact, you should only create a handheld stylesheet if you have a specific idea of how you want your page to look on a handheld device. Handheld browsers have certain limitations, and if you are unwilling to cater to those limitations, just leave well alone, and make your stylesheet target all media types.

Read the rest of this entry »



Different Type of Media Types in CSS

CSS provides an easy way to target browsers on different types of devices, or different uses. For example, the design you produce for a normal desktop browser may not be suitable for a handheld device, or a printer. These are known as media types.

There are several media types, and most browsers will generally concentrate on just one or two, depending on what they are designed to be used for. Opera is by far the most versatile, and supports six different media types.

All major browsers use screen media as their default, and will apply screen media when viewing a Web page normally.

Read the rest of this entry »



How to Use External Files in CSS

My friends may be few CSS beginner learners already know about that it is possible to use external files as part of your CSS. For example, you may want to apply a background image to an element. This is done using the background-image style, and the related background style. These load images using the url value:

1
  background-image: url(background.jpg);

The url is relative to the file the CSS is in, so if you are using external CSS files, you can use the same file from pages in any directory, and the CSS will always reference the correct images.

Read the rest of this entry »



How to Use Colors in CSS

Now we are going to make our life full of colors……. :) Yes we are going to learn how to use colors in CSS and it’s very interesting. Many styles accept colors as values, or part of their values, such as color, background and border.

Note : The colors spelling use in CSS is American spellings, not the British (or other) for example: color instead of colour, and gray instead of grey. But CSS 3 colors allow either spelling of grey-based colours, but you may find that browsers expect the American spellings.

There are five main ways to specify colors, #rrggbb, #rgb the two rgb( ) syntaxes

Read the rest of this entry »



Writing CSS in a Right Way

Today we are going to learn so many things in CSS. Lets start with how to write CSS in a write way. First of all define the element the CSS is written for. Then use

{ and after putting in the styles, close it with }

This might look like this:

1
  body { styles go in here }

In this case, the ‘body’ is known as the selector. This can get more complicated, and can included many different selectors.

For several elements to use the same style, you can separate them with commas:

Read the rest of this entry »



How To Add CSS in a Webpage

When using CSS, it is important to make sure that browsers use their most standards compliant response. You will need to ensure that your DOCTYPE triggers standards mode rendering for these browsers, or they will assume your code is relying on some mistakes of older browsers, and will try to replicate some them to various degrees, which can produce unpredictable results.

 
Different Ways of Adding CSS in a Webpage

There are two ways to include CSS on a page.

Read the rest of this entry »



© 2008 HeyGB.com