How to Use Different CSS Style Sheets For Different Browsers (and How to Hide CSS Code from Older Browsers)
In an ideal world, you only need one set of CSS style sheets for your website, and those styles will work with every browser currently being used. This, as every webmaster soon finds out when he/she uses CSS, is a pipe dream. The modern browsers all have uneven levels of implementation of the CSS standards. As though this isn't bad enough, their implementations are often buggy - and they don't share the same bugs! And when you have solved that tricky bit, you find that your site has certain visitors (often your best customers) who, for various reasons, are using older browsers that have only rudimentary support for CSS.
What most (if not all) CSS-using webmasters want is a way to specify that a certain style sheet is to be used by such and such a browser and not others, as well as to hide other style sheets from older browsers.
The Good and Bad News
The bad news is that there is no standard documented method to include or exclude style sheets from being used by every browser still being used on the Internet.
All is not lost however. The good news is that there are a number of tricks, workarounds and even non-standard but documented methods available that you can use to have your style sheet included by some browsers and not others. The workarounds often rely on known bugs in certain versions of specific browsers.
On the other hand, even with these workarounds and tricks, you will probably find that there are certain browsers that you want to code for but do not have any reliable means to detect and work around. However, at least with the help of the tips listed here, you should be able to design a CSS-based website that works with the most commonly used browsers
Preliminary Tips for Coding
Before you start coding your site using CSS for specific browsers, here are some tips that hopefully will make your life easier.
Design From Scratch
Most webmasters who have had to convert their existing website to CSS say that they find it easier to design their site from scratch in CSS than to try to find a way to reproduce their old layout in CSS.
Another reason for designing from scratch is that CSS allows you to do many things not possible using the old tables paradigm. Rethinking your entire design allows you to take advantage of the new possibilities.
Code to Follow the CSS Standards First
Many of the web designers hanging out in webmaster forums have found that it is far easier to develop their CSS code for a highly standards-compliant browser like Firefox first, and then only later add the workarounds to make their code work on IE, than to code for IE and then try to make it work for Opera, Konqueror, Safari and Firefox.
It is also logical to write for a more standards-compliant browser first: sooner or later, Microsoft is bound to issue a newer version of IE that will have the existing CSS bugs fixed. When they do so, all you have to do is to remove the workarounds which you created and you're done. If you write your main style sheet with styles that are coded in a non-standard way to deal with IE bugs first, you will wind up having to rewrite everything when Microsoft fixes the bugs.
This is not to say that Firefox does not have its own share of CSS bugs. As such, my personal recommendation is to code with the two (supposedly) most standards-compliant browsers first, ie, Firefox and Opera, while at the same time periodically making sure that your CSS code validates with the W3 Consortium's free style sheet validator. You can add the workarounds for IE later.
(If you are not sure what validation means, or how you can get it done, check out my article on HTML and CSS Validation: Should You Validate Your Web Page? at http://www.thesitewizard.com/webdesign/htmlvalidation.shtml
Use External Style Sheets and Take Advantage of the "Cascading" Aspect of Cascading Style Sheets
One way to handle the bugs and omissions existing in different browsers is to put all your standards-compliant CSS code in a separate (external) style sheet file that is loaded by every browser.
Then, when you find th
in reference to:
Google (
view on Google Sidewiki)
10 Strategies To Make Your E-Commerce Website A Success
E commerce websites have come of age. As customers realize the ease and benefits of online shopping, the popularity of e-commerce websites have soared like anything else. However, with the increase in the number of Ecommerce websites vying for attention, it has become important for them to devise strategies to be better than the competition and attract more traffic. Here are some new trends and techniques that can help your Ecommerce processes.
Focus on User Experiences
Often we concentrate so much on improving the usability of the website that we completely forget about the user experience. The way users feel on the website goes a long way in influencing their purchase options as well as their general perception of the website. Therefore, try to connect with the visitors on intimate level and then build up your branding through strategic marketing techniques.
Provide Customized Messages to Specific Audience Segments
The chances of sales increases when the audience is more targeted. When you segment your audiences, you know about their general common preferences and likes. This will also give you an idea about what segments are useful and most profitable. In turn, you can customize your sales message and make sure they receive more relevant and personalized information and offers.
Create Compelling Content
Content is the only source of direct communication with your website audiences. Therefore, make it as compelling as you can . The main objective of your product page should be sales conversions. Include product images and videos along with content that convinces them to hit the 'Buy' button.
Eliminate Unnecessary Page Elements
A majority of Ecommerce websites carry a bulk of undue weight because of unnecessary page elements like blinking banners, rotating graphics and annoying flash-animations. Attention grabbing works best on subtle levels. Also make sure the information you provide on the website is short and crisp.
Include Videos on the Website
Videos are an emerging source of product promotion with more and more website embedding videos on their websites to promote their businesses. You can upload videos that provide demonstrations of your products and show how they work, exhibit their different features and show how users can benefit from their use. Moreover, video inclusion has certain search engine benefits as well.
Involve your Website Audiences
The three main elements of a successful website are - Content, Communication and Commerce. You need to involve your audiences and make them feel that they are a part of the website. Include a form on audience interaction on your website. Provide them with an option to review the products and participate in forum discussions etc.
Provide Free Shipping Options
A little known secret of the e commerce industry is that shoppers often shy away from buying a product because of the additional shipping costs that are involved. Thus if you decide to waive of the shipping costs, you'll have more sales. If its not a profitable option individually, provide free shipping options for bulk orders.
Optimize Products for Local Searches
While it is great to business on a global scale and cater to international customers, you can get huge visitor traffic with localized search engine marketing. Promote the products on your website on domestic search engines. You can also customize your product descriptions, tutorials, public relations and ad campaigns to suit the tastes of the local markets.
in reference to:
Google (
view on Google Sidewiki)
How To Enhance The Usability Of Your Homepage Design
The homepage of your website is the face of your online presence. It is what makes the first impression on online audiences about your company and business. When people type in the URL of your website, they reach your homepage. The homepage, should therefore present a brief introduction about the website and lure visitors to browse further within. The homepage is perhaps the most important page of the website and thus you need to take adequate measures to enhance its usability. Here are some tips to ensure the same.
Include a Crisp and Catchy Tagline
Draft a tagline for your website homepage that informs about the company and business in a simple sentence. When visitors enter the homepage, they should know what the website and the company is all about just by reading the tagline. In fact, by drafting a catchy tagline you can catch the attention of your visitors and make sure they don't forget you.
Draft a Meaningful Title Tag
The title tag of your homepage should have your company name followed by a very brief description of the website. Avoid using words like 'Welcome' or 'The' that just populate the space and do no value addition. Instead, try to include your relevant keywords and phrases in the title tags.
Cluster All Corporate Information
Website visitors generally don't bother reading about the company. However, there are times when they decide to do business with you only after they are convinced about the company. In such scenarios it is important to have good corporate information on the website. Create an About Us page on your website that is dedicated towards informing visitors all about your company and business and provide a link to it from the homepage.
Focus on Key Tasks of the Website
The homepage of your website should act as a guide for visitors and help them find a browsing route. It should provide a clear starting point to do what they want to do i.e. there should be clear links to the main areas of the website where visitors might be interested in going.
Include a Search Box
The search box is indispensable for any website. Internet users are an impatient lot and they love anything that cuts short the action steps. Search boxes enable visitors to search for the exact information that they need by just entering a query instead of browsing through categories to fins what they need. Make sure your search box is at least 25 characters wide so that it accommodates multiple queries.
Offer Snapshots of Inlying Content
The homepage of the website is where you can showcase things and lure visitors to further explore the website. A good idea is to place snapshots or post the topics of important content within your website. Whether it is a recent article or a report that you have on a certain web page, offer a preview on the homepage.
Use Meaningful Design Elements
The homepage of a website is important and should welcome visitors. However, that doesn't mean you can load the page with useless design elements and flash animations that offer no value but only increase the file sizes.
Kabir Bedi is the senior web consultant at LeXolution IT Services, a reputed offshore web development company that provides an extensive range of web design services and web Development services. He has completed several international web design projects for international clients.
in reference to:
Google (
view on Google Sidewiki)
Here's a different way to generate forms using PHP, and to take care of all the required field validation too. It might help someone:
array(
"type"=>"select",
// attributes are an associative array
"attributes"=>array(
"mr"=>"Mr.",
"ms"=>"Ms.",
"miss"=>"Miss.",
"mrs"=>"Mrs.",
),
),
"first_name"=>array(
"type"=>"text",
"size"=>40,
"required"=>true,
"onclick"=>"alert('test');",
"style"=>"border:2px solid #CCCCCC; padding:4px; font-size:15px;",
),
"last_name"=>array(
"type"=>"text",
"size"=>70,
"required"=>true,
),
);
$errors=array();
if($_REQUEST['save']){
// do sql here...
$sql = "INSERT INTO foo SET insert_date=NOW()";
foreach($elements as $element_name => $el){
if($el['required']&&!$_REQUEST[$element_name]){
$errors[]="Required field missing: $element_name";
}else{
$sql .= ", `$element_name` = '".addslashes($_REQUEST[$element_name])."'";
}
}
if(!$errors){
// call sql:
// $res = query($sql,$db);
// $member_id= mysql_insert_id($db);
// redirect after post back
header("Location: example.php?member_id=$member_id");
exit;
}
}
global $elements;
function fb($elem){
global $elements;
$el = $elements[$elem];
if(!$el['name'])$el['name']=$elem;
if(!$el['value']&&$_REQUEST[$el['name']])$el['value']=$_REQUEST[$el['name']];
switch($el['type']){
case "textarea":
?>
$val){ if($key=="value")continue; ?> ="" >
$val){ ?> ="" >
$val){ if($key=="attributes")continue; ?> ="" >
- select -
$val) {
?>
selected >
Salutation:
First Name:
Last Name:
First name and last name are required fields. Try clicking save without filling them in.
View codin reference to:
required field validator in php - Google Search (
view on Google Sidewiki)