ورود

نسخه کامل مشاهده نسخه کامل : CSS & its benefits



Vahed
06-10-2007, 21:06
Cascading Style Sheet (‘CSS’) is a technique used to define styles in HTML for elements being displayed on a web page. You may use separately font, color, etc tags to define how information will look like but it is always recommended to use CSS for such things. Before we discuss the benefits of using CSS lets first know types of CSS, there are two types of CSS inline and external. In inline the style is defined within the web-page whereas in case of external all styles are defined in a separate CSS file with a unique name and in the webpage the style are refereed using the names defined in the CSS file. If you are going to use inline style then you will be using the ‘Style’ tag of HTML, whereas in case of external you will be using ‘Link’ tag to include the CSS file and then the Span tag to give a call to a particular style defined in this file.
It is better to use external CSS as it keeps all the styles defined in a separate file and if any change is required it can be done by just making the change in the CSS file and there will not be any need of making any change in the web-page itself. The benefits of using CSS are as listed below: -
a) A change done in one CSS file will automatically get reflected in all the pages that are using the same style, which saves time.
b) It ensures the consistency of styles being used to display same type of information on different pages.
c) The content will remain separate from the presentation.
d) While developers are working on the pages designed to make it dynamic they will not have to worry about the presentation as they will not be working on the CSS file that is created to define the presentation.
e) When it comes to presentation it makes maintenance of the website easier.
f) The amount of code is less if CSS is being used to define the presentation.
g) It makes the site more search engine friendly, because the amount of code in the page will be less and thus it will be easier and quicker for search engine crawlers to parse the page and fetch data items they will use for indexing the website.
h) Downloading of a CSS file is faster thus the downloading time of the page is also less.
i) It makes your website browser compatible as CSS is recognized by all commonly used browsers. I am sure there will be many other benefits, which the users of CSS would have found while using it for a specific requirement. It’s not just that CSS will just allow you to define the font, color, size etc of textual information you may even use it to define the positioning & spacing of the elements being displayed in a web-page. Also CSS allows you to have rollover affects on Images, which is very much possible with JavaScript, but if done thru CSS will make sure that there is not much of code written on the page, which is good for search engines and since it is supported by all major browsers so you will not have to worry about JavaScript not functioning properly is some browser.
Since now the world is moving to handheld and PDA devices, CSS plays an important role in designing pages that for such devices, so if you are using CSS and have users who will access your site using handheld devices then this means your users will always have a fulfilling experience while browsing your website. So let’s switch to CSS……..



IT Articles 2007