Article Details
Embracing Cascading Style Sheets (CSS) Makes Good Sense. |
| Date Added: August 20, 2009 02:56:23 AM |
| Author: ashish |
| Category: Computers & Internet: Web Hosting |
Why do I like Cascading Styles Sheets (CSS) and what makes CSS so great. The answer only makes sense if you know what CSS is. The Holy Grail of CSS is to separate the content of a web page from the instructions that control what it looks like. This makes it much easier for various devices to display the web page correctly. The same page would display correctly on all standard web browsers (Internet Explorer, FireFox, Opera, Netscape, etc.), and devices used by persons with a handicap, cell phones, other devices, and yet-to-be-developed interfaces. The web site designer would not have to make separate pages for these devices. However, reality is different and here in the real world CSS does not do all these things. It does have enough positive points to make it worthwhile to learn and incorporate it into your web pages. There are multiple ways to control how something looks on a web page. The color, size, and font used for a headline or for a paragraph of text can be defined with in-line styles and tags. The term "in-line" means that the commands for controlling the color, size, and font are mixed in with the content. This makes the source code for the page cluttered and hard to read and edit when you want to update it or fix something. Also, because you're repeating the same commands over and over throughout the page, the file size of the page gets largër and hence slower for those browsing your site. As opposed to in-line styles, CSS is not repeated throughout the page. CSS can be defined in the head section, or put in a separate file and referenced from the HTML file, or both. CSS consists of definitions of how a page component should render itself on the page. For example, you can define that a headline should be blue, 24 point, centered text and that a paragraph should be black, 12 point, justified text. Once that is defined, any normal HTML paragraph tags or headline tags would use these definitions when rendered. You can define almost all the normal HTML objects this way; background color, background image, background image position, tables, cells, images, divs, etc. This leaves your HTML code clean and much easier to read. Just like those Ronco TV commercials, there's more! If you have a multi-page web site and you use CSS and all your CSS definitions are in a separate file, you have one place to go to change the look and feel of all the pages in your site. Imagine if you have a 50 page site and you learn that the size of your text in all your paragraphs is too small or the wrong color to maximize salës: instead of having to edit 50 pages and change the definition of each paragraph, you simply edit the CSS file and you're done! But with CSS what do you do if you want one paragraph or a set of paragraphs to look different? You define a class. If you have a right column where you display ads in your CSS, you would define a class and give it a name such as ".rcol", then you would define the necessary items that you want to look different (p tags for example). ".rcol p" would be used to control how a paragraph tag was rendered. You simply add "class=rcol" to the paragraph tag, or the table tag if it's in a table, or div tag if it's in a div, etc. This is also where the cascading in CSS comes into play: the default definitions cascade down into a class as long as the class does not contain something that overrides the default. This means that in our example text rendered in a paragraph tag looks different for the rcol class, but because that's the only thing we've defined for rcol, everything else would use the same styles as the rest of the page. You can also define size and positioning for objects in CSS. This is one place where we hit the real world of CSS pretty hard. Not all browsers support the size and position commands the same way. This leads to hacks that define a position and then use a command that is known. For example, to cause Internet Explorer to bail out of the CSS, after that line you use a position command that Netscape for example understands. CSS uses the last definition of an object so this technique can be used to "trick" or "hack" CSS into working across more browsers than it normally would. I don't recommend doing this. One reason is that it's messy and easy to forget why you did something. The other reason is because as browsers are updated, or new devices come online, they may not follow these unwritten and unsupported hacks and your pages are apt to be all messed up. To get around this I usually use CSS as much as I possibly can and then use tables and in-line definitions to control positioning and size. Some people will go to great lengths to use CSS for everything, even replacing all tables, but here in the real world, you should get the page built, functioning, and in a form that can be used reliably on as many platforms as possible. |
|
|
How Search Engine Optimization can attract links for your website?Search Engine Optimization is a task of placing the website on the top pages of the major Search Engines. This is basically done to add suitable visibility top your website so that it can attract sufficient traffic to the website | |
Activities to Build Self-esteemYou possess more personal power than you can possibly imagine. The ability to manifest our own reality is the power of creation itself and our self-esteem is an integral part of how we wield that power. | |
Choosing a Web Development FrameworkI recently had the opportunity to develop a small online booking system. This time round I was determined to make use of some development framework. Not for me the slow slog of writing all my code from scratch - surely we have moved beyond that now in web development? | |
Embracing Cascading Style Sheets (CSS) Makes Good Sense.Why do I like Cascading Styles Sheets (CSS) and what makes CSS so great. The answer only makes sense if you know what CSS is. The Holy Grail of CSS is to separate the content of a web page from the instructions that control what it looks like. This makes it much easier for various devices to display the web page correctly. | |
How To Make Your Web Site Popular FastA website without traffic might just as well have never been built. It's invisible and unsuccessful. It's a fact - No Traffic = Invisible! There are many tried and tested free methods for driving web traffic to your website. Many of these free methods are absolute gems that can drive truckloads of web traffic to your website. | |
Acquire the assistance of Affordable Web Hosting Company to promote your business.In the recent years Web Hosting was so expensive. But with the advancement in technology, excellent Web Hosting is available at affordable prices. But choosing the best Affordable Web Hosting Company is very crucial task and it takes too much time. | |
Healing the Inner ChildWe know as human beings that to be an adult is just to be a child that has grown old. Inside our body we carry feelings; all of our memories. In some cases we are challenged by the corresponding elements of our environment in the guise of our children. If something has happened to you in your childhood it can reawaken in adult life when you | |
How We Address Mistakes Defines Our Character!No one goes out of their way to make a mistake, but once we understand a mistake has been made, that is when choices begin and our character will be demonstrated. If it is our own personal mistake, we can ignore it, wait until later to deal with it, or immediately | |
Your Ultimate Guide to Window Shades ShoppingShopping for window shades can be both a fun and stressful activity. It's fun because it means you'll have something new to put to your windows; but it's a little strenuous because you have to choose from a wide range of designs available in the market. | |
Stripper Clothes, Sexy Heels and a Little Attitude Can Really Spice Up Your EveningsEvery man wants his partner to be sexy, aggressive and take him when he least expects it. You can accomplish and turn up the heat by wearing scandalous and daring stripper wear for an evening of fun and excitement. | |
PR: 3
| Website Rankings - Optimization Website Rankings - Optimization |
| (0 Reviews. Rating: Total Votes: ) | |
N/A
| gucci shoes,wholesale gucci shoes wholesale gucci shoes at wholesale price from leading Chinese wholesalers: cheap gucci shoes, enjoy online wholesale cheap gucci shoes and become a gucci shoes wholesaler now! - Read more http://www.708gucci-shoes.com |
| (0 Reviews. Rating: Total Votes: ) | |
N/A
| 708 football-jerseys 708 football-jerseys offer you all kinds of nike shoes,especially Cheap jordan shoes and wholesale jordan shoes,also offer customer service will help you do buy. - Read more http://www.708football-jerseys.com |
| (0 Reviews. Rating: Total Votes: ) | |
N/A
| 708ugg-boots 708ugg the cheapest, have the latest and most popular ugg shoes, and the best service. - Read more http://www.708ugg-boots.com |
| (0 Reviews. Rating: Total Votes: ) | |
N/A
| Christian Louboutin Boots,Christiancarts Christiancarts.com - Fashion and Discount Christian Louboutin Wedding Shoes Worldwide. Christian Louboutin Sale here includes Boots, Pumps, Heels, Sandals and many more. - Read more http://www.christiancarts.com |
| (0 Reviews. Rating: Total Votes: ) | |
