Thursday 26 September 2013

EASY SEO PROCESS

EASY SEO PROCESS

The Google optimization process is not fully structured, but could result in the following steps:

1) Analysis of competition.

A competitive analysis will help us to know what strategies they are using those "fight" with our company to win the segment. Through this research we know your keywords, its strengths and weaknesses. This does not mean it will copy all of its attributes, but watching you learn. Learn about our competitors will be very useful to know where we can fight and how we improve.

2) Survey of Keywords.

Through a detailed study we know the keywords in place and largely used by the public they will target your company. Match in the keywords is an essential step for the success of their "virtual branch", since they will transport visitors from search engines or search engines to your website.

3) Development of a database for the site.

We must improve the site's pages, and if we start from scratch, create them. This step will optimize both the HTML coding (headings, metatags, etc..) And "site architecture" (internal structure of links to Web pages that compose your site) as the graphical interface of the website (content and design). Recall that a website that has a great design but not provide content that visitors need, is a sterile site.

4) Incorporation of keywords.

Once you choose the most effective keywords, we put on our website. These should appear on the most important pages (Home Page and Services page) and the right balance. An excessive repetition of the same would result in some Search Engines erase the site from their lists.

5) Review and building links.

Acquiring and quality related links pointing to your website generates 95% of success in trying to get high rankings in Search Engines. While increasing the Network Status for search engines is also important to have lots of links pointing to your pages, we see that the really important matter is the quality and degree of relationship of the same with your site.

Directory Submission SEOs ( Search Engine Optimizing people )

Directory Submission

Directory submission is proven to be a wonderful method for gaining quality one-way incoming back links. Even newbie SEOs ( Search Engine Optimizing people ) knows how incoming links play an important role in today's search engine optimization procedure. Higher the quality of incoming links better your search engine rankings and internet visibility.

If you are a business owner and seeking to make presence of your website on the World Wide Web then directory submissions is the most viable option. The basic aim of directory submission is to create one way links to a website. This in turn generates more traffic flow towards your website and improves the search engine rankings. This method is perhaps the best suitable and affordable option of search engine optimization. It offers huge opportunities to promote a business online. In fact, directory submissions are the most essential factor to consider while developing marketing strategies of your business.

Directory Submissions benefits

Directory submission is the most widely and commonly used approach to build back-links towards an e-commerce website. Mentioned below are the benefits of directory submissions:
• Back links: One of the major objectives of directory submissions is to generate link building towards an e-commerce website. Generating back links are the major benefits of web-directory submissions which in turn results in more traffic flow towards a website.
• Search Engine Indexing: Another major benefit of directory submissions is guaranteed search engine indexing. The search engines locate your website following the back links form other websites. If your website’s link is discovered on the directory site, the spiders will follow the links to your website, thus results in increasing the visits and indexing in the databases of search engines.
• Frequent visits by spiders: Search engine spiders often visit the websites present on World Wide Web to collect information for archives. The more back links a website has the more frequent the spiders will visit the website and higher a website will rank.
• Anchor Text: Using anchor text on your website will eventually be hyperlinked to your website providing you an anchor- back link text from the directories. Hence directory submissions using keywords as anchor-text will boost your link reputation.

Avoid top four mistakes
As you initiate to make use of directory submissions in order to increase the business prospects and achieve success, there are somewhat four mistakes that are suggested to avoid:
• Ignoring the rules: Every directory comprises of its own set of guidelines and have real managers other than web spiders to review the website’s submissions. If you fail to follow the guidelines of the directory submission then there is a possibility to be rejected.
• Turning submission into sales pitch: The directory submissions made by you should only concentrate on your business facts and website. Using marketing phrases or flowery language will lead to rejection of your website by the directory managers. Always use third person language and be objective. Avoid keyword spamming!
• Stuffing the title: There are a few directories that require submitting a title matching your website’s name while various submission directories permit you to incorporate keywords as well.
• Use of errant e-mail address: Ensure that the e-mail address you have submitted matches well with the domain. The directory editor would be doubtful if received any e-mail address from Gmail, Yahoo and Hotmail. These search engines are most frequently associated with mass-submission software.

YOUR SEO CHECK LIST

YOUR SEO CHECK LIST

Here are Some tips to get Top Rank in all search engines. It is advised to act upon one step daily and achieve your goal.


Keyword Optimization

Having well written/optimized texts and using the right keywords right is extremely important in SEO. Make sure that before launching your website, you can give a positive answer to all the questions below:


1. Did I conductive an extensive keyword research? Did I find all the popular terms that are relevant to my industry/niche/website?
2. Did I choose the targeted keywords wisely? Have I made sure that I can compete for the selected terms?3. Did I write unique, high quality texts that will be considered useful both by the Users and by the Search Engines? Have I performed a spelling check to all of my texts?
4. Do I have unique titles and descriptions in all the pages of the website?
5. Did I add all the important keywords in the page Titles, the Meta-Descriptions and the HTML Headings (H1-H6)? Have I optimized my texts for those keywords?
6. Are the Titles and Meta-Descriptions compelling for the users? Will they click on my page if it appears on Search Engine Results?
7. Did I use keyword combinations that are likely to be searched by users? Have I optimized my pages for those keyword combinations? Did I incorporate in the text synonyms that are likely to be used in the queries?
8. Do I have a descriptive alt text in all the images of my website?
9. Have I ensured that the content is not over-optimized, that there is no hidden text in the pages and that no Keyword Stuffing techniques are used?
10. Did I keep my pages targeted by focusing on a small number of keywords per page?
11. Have I kept the content of my pages relevant to my website’s theme? Am I sure that I have not optimized my pages for irrelevant terms?
12. Are the most important keywords of my page in the beginning of the document?
13. Did I make sure that my pages will not compete each other on SERPs and that I do not have lots of different pages optimized for exactly the same keywords?
Note that by using SEO Tools you can speed up your checks. Analyze your pages by using the Keyword Analyzer in order to ensure that your pages are targeted and optimized for your selected keywords. Additionally the SERP Analysis tool can help you analyze and evaluate the competition and see if it is possible to compete for the selected terms.

Website Development

The techniques that are used in order to develop a website are extremely important and they affect the SEO. So ask yourself the following questions and make sure you have done everything properly.


14. Is my website well coded? Is it cross-browser? Have I made sure that my pages contain no broken HTML that is likely to affect the analysis of the site? 15. Have I developed my website by using Search Engine friendly technologies? Is someone able to access my website without requiring him to use Flash, Silverlight, JavaScript/AJAX, Java applets, frames etc?
16. Is my menu visible from all the pages and is it developed in HTML so that the search engines can find the rest of the pages?
17. Is my site easy to be crawled? Do I provide text links for all the pages of my website?
18. Do I use properly the meta-robots tags?
19. Did I take steps to eliminate duplicate content by focusing on the Link Architecture, by doing 301 redirects when required and by using proper canonical tags?
20. Did I make sure that I don’t use unnecessary or incorrect HTTP redirections?
21. Do I redirect the non-www version of my website to the www version or vise versa?
22. What is the loading time of my website? Have I done everything I can to reduce it?
23. Am I certain that I do not do Cloaking and that I have no Doorway pages?

Link Structure, URLs and Links

In several articles in the past we have discussed how important it is to develop a solid link structure. Below we list the most essential checks that are related to the link structure, the URLs and the links:


24. Did I incorporate the important keywords in my URLs? 25. Have I ensured that my URLs are not too lengthy or too spammy?
26. Am I sure that no Session IDs (or other unnecessary variables) appear in my URLs?
27. Are my URLs static and SEO friendly (they do not include the “?” char)?
28. Do I use dashes instead of underscores in my URLs?
29. Have I ensured that I do not have too many outgoing links per page?
30. Do the anchor texts of my internal links contain important keywords? Are their text short butdescriptive? Are these keywords the same with the ones that I selected during keyword optimization?
31. Do I have an optimized Link Structure? Do I use a tree-like architecture where the top level pages are the most important pages of my website?
32. Have I linked the most important pages directly from homepage or from the top categories?
33. Have I ensured that most of my PageRank/Link Juice passes to my internal pages and that there are not too many links pointing to external sites or dangling pages?
34. Have I eliminated all the links that point to different versions of the same page, causing duplicate content problems?
35. Have I eliminated all the broken links?
36. Do I use meaningful internal anchors when necessary?
37. Am I 100% sure that I do not have any hidden, spammy or paid links in my site?
38. Do I usually use text links instead of image links, when I point to an internal page?
39. Have I nofollowed the links that I do not trust? Have I decided on whether I will do PageRank sculpting?
In order get a detailed view of how the PageRank flows within your site and what is the link structure of your webpages, make sure you use the Link Structure Tool. It will provide you with detailed statistics andgraphs along with all the data you require to evaluate your current link architecture.

Domains & Hosting

Both domain names and hosting can heavily affect the performance of your website and your SEO campaign, so make sure you check the followings:


40. Have I checked that my domain has no previous bans from search engines? 41. Does the domain name contain any useful/relevant keywords?
42. Have I selected the TLD of the domain wisely? Am I certain of why I want to use a generic or a country specific TLD?
43. Do I understand what are the benefits and the tradeoffs of using subdomains?
44. Do I know in which country my website is hosted? Am I certain that the website should be hosted in that country? (Given that the server location is a signal)
45. Is my hosting company reliable? Do they update/patch their servers regularly? Do they offer the necessary modules that will help me build an SEO Friendly Website? What is the uptime percentage? What are the loading times? How many sites are hosted under the same IP?

Off Page and other Checks

After checking your webpages you need to ensure that all the necessary files have been built, that all of the necessary accounts are created and that you are ready to go live. Check out the followings and make sure you have not forgotten any of the basics:


46. Did I create XML and/or HTML sitemaps? Have I submitted them to the search engines? 47. Have I created a robots.txt file? Do I know exactly which pages I have to block? Am I certain that I want to block those pages?
48. Have I created an account on Google, Bing and Yahoo Webmaster Tools? (Yes you should still use Yahoo tools until they are fully integrated with Bing).
49. Have I created a Google Analytics account (or use a similar Web Analytics service)? Have I added the tracking code in all the pages of my website? Am I sure? Am I 100% sure?
50. Have I set up an RSS feed (mainly for blogs and news websites)? Do I use the RSS autodiscovery technique? Have I added the RSS URL on the HTML Header of my pages?
51. Do I understand what are the benefits and the tradeoffs of using Geo location? Have I decided on whether I should use it on my website?
52. Have I evaluated the design on my website? Have I set up the call to actions?
53. Have I setup the scripts to monitor user’s activity?
54. Have I decided on whether I will do A/B testing?
55. Have I developed a solid Link Building strategy? Have I gathered all the relevant high traffic directories of my industry and the search engine’s local listings where I can submit my business? Do I know which websites link to my competitors? Do I have a plan on how to acquire high quality links?
56. Have I decided on whether I should use Social Media to promote my brand? Have I developed a solid Social Media strategy? Did I add the social media buttons in my website? Have I created the profiles?
57. Have I tested my website by using the Web SEO Analytics Toolbox? How can I improve the site based on the SEO reports?
58. Am I positive that I use no blackhat techniques and that I do not violate Google ‘s Guidelines?
59. Have I created the Email accounts, the FTP accounts etc? Have I set up everything?
60. Have I tested thoroughly my website? Am I ready to go live?
I strongly believe that if you complete all of the checks that are described above and if you use this SEO checklist you will be able to detect most of the flaws that can damage your SEO campaign. I wish you the best of luck and I am looking forward to your suggestions and comments.

What Are Keywords? How To Use Them

What Are Keywords? How To Use Them

Keywords are those specific words which are searched in a search engine. When you search any information on the web in any order, you open a search engine and write some keyword describing what you are looking for. At the other end, the search engine checks your desired keyword related information in its database and shows the results listing pages according to the words submitted. These words that are used to search anything called keywords or search terms. If you have used some search terms, you will know that even a single keyword shows a broad list of required information. To make your search better, you need to use keyword along with other words or a phrase. This gives more relevant search results. You can get some keyword suggestion from different online tools.

Importance of keywords
Keywords play an important role to increase traffic in your website. Keywords can be used in your website related to the search engine to offer you targeted traffic to you web pages. Keyword facilitates people who need your information or any product to reach you. For example, keywords are the contact numbers for your business and search engines like Google and Yahoo are like the telephone directory, this telephone directory list your contact and address in shape of keyword.

Which keywords are the best for my website?
Now, how you will decide that which keywords the best and relevant to your web pages? This is the most important to use top paying keywords and good keywords related to your website. For this, for a while consider you as a customer who goes to the shoe shop and asks for their required shoe. What type of questions you will ask to demand your required design, size, company and she price? And what words or phrase you will use? These will be your keyword and appropriate use of keyword in a phrase. Now in the same way, use keywords in phrases relevant to your product or web content.
List your keywords and phrases or get some help from adwords keyword tool, keyword selector tool or another keyword tool and also use keywords analyzer to find top paying keywords related to your website. Now use your keywords in your web content in an appropriate phrase and wait for the result. Remember, that a single popular keyword have a lot of competition to get top ranking in the search result.

Are you using popular keywords?
Do not expect that after using proper keywords and submitting your site to the search engines ensures the flood of traffic to your website. Seo is not a part time job, it require time and concentration as well as seo skill. Firstly, search engines can take several weak to process your submission. Secondly, some search engine considers many other factors such as site popularity and traffic to rank your site. Site popularity is determined by the back links to your site. Therefore, it is necessary to enhance your site popularity; you need to establish reciprocal links techniques.

Another important factor that most people forget while putting keyword position, the people may not enter the keyword or phrase in search engine as your keyword. So using keywords according to their nature is very necessary.

It is advised you use some keyword search tool or google keyword tool to find some good adwords keywords, ppc keywords and adsense keywords relevant to your pages. Don’t forget that your purpose is to get targeted traffic therefore, the more accurate and appropriate keywords, the more chances your site will be reviewed. https://adwords.google.com/select/KeywordToolExternal can help you get some good keyword according to your site.
Some keyword tips
Let me tell you guys that how I use my keywords:

   1. Best Place For Keywords
      The best places of keywords in your pages include at the top of your page, in the headline, sub headline, in title, first and last paragraph. Search engine spiders are to as wise as you, they search for the exact keyword. Therefore if you really interested to boost up your traffic, then use specific keywords in the exact phrase. Try to use the keyword in the first paragraph, in the first line or sentence.

   2. Keywords And META Tags
      Using keywords in META tags always a good technique to enhance the site and keyword traffic. It doesn’t matter which tool you are using to design your pages, after you have finished your design, save your work and open the HTML coding. Check
      the HTML coding,
      Title: The sites title something that you show at the top of the browser screen in blue button. You can change the site title with very shot description and include one keyword.
      Description: Now do something same like title for the keyword and description. For keyword type some appropriate keyword and for site description, write a short sentence, this will be shown in browser when visitor will search your site and the search list will appear on the browser screen. You can write this description at least 25 words and include one or two keywords. It is better to use different site title and description and keyword for each page.

   3. Keyword And ALT Tag
      If you add an image or picture, you can include an ALT tag containing a short description with a keyword. The search engine robot will read your ALT tag like META tag.

   4. Put Keyword in Domain Name And Page Title
      Try to find a domain name containing keyword such as seotips or seo_tips. This will get you additional fairy points same like including keywords in your page names.

Top 10 Basic SEO Checklist

Top 10 Basic SEO Checklist

Below is a keyword checklist to ensure that you follow the basic top tips to optimise your pages correctly including existing, main pages and secondary ones so to present them to the search engines in a acceptable manner, generally accepted search engine algorithm rules.



URL: Get your primary keyword as close to the beginning of the URL as possible.

Title Tag: The title should be between 10 and 50 characters and include one or more keywords while still being descriptive.

Description Meta Tag: The description meta tag should be insightful and useful but it should also contain one or two of your more important keywords.

Keyword Meta Tag: It makes sense that you should include all of your keywords in the keyword meta tag. Do not include any words that don’t appear in the body of your text.

Keyword Density: Your content should be made up of all of your keywords and other text. A total keyword density (all keywords) of around 12% is the maximum you should aim for if you exceed this you could fall foul of Google’s acceptance and cross the line and commit the sin of ‘spamming’ and key word stuffing. Anything less than 2% is unlikely to yield good results. Density for a single keyword should be between 1% and 7%. 1% seems too low and 7% a little too high. Wherever possible aim for approx 5% with the primary keyword and 3% with secondary and subsequent keywords. This is balance which requires very careful consideration and calculation. SEO experts are more skilled at this fine balance and you should seek advice on this subject.

Header Tags (e.g. H1 and H2 tags): More weight is given to keywords that appear within H1 tags, then H2 tags and so on.

Text Formatting Fonts (e.g. strong, bold and underline): This may not offer much weight in algorithms, but generally if you bold the first instance of your keywords and the last instance of your primary keyword you should see some positive results.

Beginning of Text: The closer you can get your keywords to the beginning of your page content the better. Try to include your primary keyword within the first sentence or two and also within the last paragraph.

Key-Phrases as Whole Phrases: If you are targeting Internet Marketing as a key phrase then do not split the words up if possible. Some effect is noticed if the words are split, but much more benefit is received by including the phrase as a whole.

Images Alt Text: Include your keyword at least once in the Alt tag of any images. Ensure that the text is relevant to the image and gives some information.

WHAT IS KEYWORDS? seo

WHAT IS KEYWORDS?

Keywords are those specific words which are searched in a search engine. When you search any information on the web in any order, you open a search engine and write some keyword describing what you are looking for. At the other end, the search engine checks your desired keyword related information in its database and shows the results listing pages according to the words submitted. These words that are used to search anything called keywords or search terms. If you have used some search terms, you will know that even a single keyword shows a broad list of required information. To make your search better, you need to use keyword along with other words or a phrase. This gives more relevant search results. You can get some keyword suggestion from different online tools.

Importance of keywords
Keywords play an important role to increase traffic in your website. Keywords can be used in your website related to the search engine to offer you targeted traffic to you web pages. Keyword facilitates people who need your information or any product to reach you. For example, keywords are the contact numbers for your business and search engines like Google and Yahoo are like the telephone directory, this telephone directory list your contact and address in shape of keyword.
Which keywords are the best for my website?
Now, how you will decide that which keywords the best and relevant to your web pages? This is the most important to use top paying keywords and good keywords related to your website. For this, for a while consider you as a customer who goes to the shoe shop and asks for their required shoe. What type of questions you will ask to demand your required design, size, company and she price? And what words or phrase you will use? These will be your keyword and appropriate use of keyword in a phrase. Now in the same way, use keywords in phrases relevant to your product or web content.
List your keywords and phrases or get some help from adwords keyword tool, keyword selector tool or another keyword tool and also use keywords analyzer to find top paying keywords related to your website. Now use your keywords in your web content in an appropriate phrase and wait for the result. Remember, that a single popular keyword have a lot of competition to get top ranking in the search result.

Are you using popular keywords?
Do not expect that after using proper keywords and submitting your site to the search engines ensures the flood of traffic to your website. Seo is not a part time job, it require time and concentration as well as seo skill. Firstly, search engines can take several weak to process your submission. Secondly, some search engine considers many other factors such as site popularity and traffic to rank your site. Site popularity is determined by the back links to your site. Therefore, it is necessary to enhance your site popularity; you need to establish reciprocal links techniques.

Another important factor that most people forget while putting keyword position, the people may not enter the keyword or phrase in search engine as your keyword. So using keywords according to their nature is very necessary.

It is advised you use some keyword search tool or google keyword tool to find some good adwords keywords, ppc keywords and adsense keywords relevant to your pages. Don’t forget that your purpose is to get targeted traffic therefore, the more accurate and appropriate keywords, the more chances your site will be reviewed. https://adwords.google.com/select/KeywordToolExternal can help you get some good keyword according to your site.
  1. Best Place For Keywords
      The best places of keywords in your pages include at the top of your page, in the headline, sub headline, in title, first and last paragraph. Search engine spiders are to as wise as you, they search for the exact keyword. Therefore if you really interested to boost up your traffic, then use specific keywords in the exact phrase. Try to use the keyword in the first paragraph, in the first line or sentence.

   2. Keywords And META Tags
      Using keywords in META tags always a good technique to enhance the site and keyword traffic. It doesn’t matter which tool you are using to design your pages, after you have finished your design, save your work and open the HTML coding. Check the HTML coding,
      Title: The sites title something that you show at the top of the browser screen in blue button. You can change the site title with very shot description and include one keyword.
      Description: Now do something same like title for the keyword and description. For keyword type some appropriate keyword and for site description, write a short sentence, this will be shown in browser when visitor will search your site and the search list will appear on the browser screen. You can write this description at least 25 words and include one or two keywords.  It is better to use different site title and description and keyword for each page.

   3. Keyword And ALT Tag
      If you add an image or picture, you can include an ALT tag containing a short description with a keyword. The search engine robot will read your ALT tag like META tag.

   4. Put Keyword in Domain Name And Page Title
      Try to find a domain name containing keyword such as seotips or seo_tips. This will get you additional fairy points same like including keywords in your page names.

White Hat SEO

White Hat SEO

What is White Hat SEO?


"In search engine optimization (SEO) terminology, White Hat SEO refers to the usage of SEO strategies, techniques and tactics that focus on a human audience opposed to search engines and completely follows search engine rules and policies. For example, a Web site that is SEO optimized, yet focuses on relevancy and organic ranking is considered to be optimized using White Hat SEO practices. Some examples of White Hat SEO techniques include using keywords and keyword analysis, back-linking, link building to improve link popularity, and writing content for human readers. White Hat SEO is more frequently used by those who intend to make a long-term investment on their Web site. Also called ethical SEO."

White Hat SEO is nothing but strategies which are considered ethically correct and legitimate by SEO's as well as search engines while indexing a site. These techniques often make for a pleasant user experience, and more importantly bring in promising results in terms of high rankings and rank stability. The content that you would find on the webpage would not be solely for the search engine ranking purpose but also keeping the visitor in mind.

An example of a White Hat SEO technique, as opposed to a black hat technique would be back link generation (White Hat), as opposed to link farming (Black Hat). Back link generation is a process / set of techniques where some truly interesting and highly relevant content is created and then it is posted online. If the content is good, people will share it with others, and thus the link is propagated across the web. Link farming, on the other hand, is the unethical practice of creating a group of sites, and then hyper linking them all to one another, with no regard for relevancy. Back link generation can be a healthy way to increase the popularity of your site, while link farming will risk your website and your business through search engine penalties and the poor results of receiving non-relevant traffic.

There are countless White Hat SEO techniques, here are a few safe and ethical practices used to increase search engine rankings for a website:

Make the most of internal linking. You may be familiar with the fact that when sites link to other sites, search engines pass value for the terms/phrases used in the link anchor text. (Anchor text is the highlighted text in the link. internal links are an effective tool in improving a site's ranking. By adding links to the content of your site that are relevant for the user you can kill two birds with one stone - improve both search rankings and usability.

When web sites link to each other, either directly or indirectly through a number of different pages, a search engine might consider those links to be reciprocal links. Building reciprocal links is another White Hat SEO technique where you exchange links with other sites to get additional incoming links to your website. However, you must remember to have a high ranking popular site link to your content in a way that is relevant to readers.

Always keep in mind the golden rule of SEO: Content is king. Well written content not only engages the reader but it also Increases search engine rankings and traffic and promotes the likelihood of quality links from other sites. You should also update content regularly, every day, or at least a few times a week. Hosting a blog is a great way to boost visitor traffic onto your site as well which in turn will create better recognition and indexing of your pages.

If you want your website or blog to work for you and bring a steadily increasing flow of targeted visitors, I strongly encourage you to consider search optimization factors early in the game. If you're thinking about hiring an SEO firm the sooner the better. A great time to hire is when you're considering a site redesign, or planning to launch a new site. That way, you and your SEO consultant can ensure that your site is designed to be search engine-friendly from the start. It's always a good idea to have an SEO Company work on your site if you're unfamiliar with SEO. They will know what keywords to use for you, and make sure that your site provides relevant information.

As web technology and its users evolve in their understanding of how to market their site the ethical way, several of them come to us to know exactly what the search engines, the social media and the consumer is looking for. For more information don't hesitate to contact us, we are happy to help.

Way To Increase Your Alexa Ranking

Way To Increase Your Alexa Ranking

Alexa Ranking
The actual Alexa search positions are a position of web sites depending on how a lot site visitors they obtain through users who've the particular Alexa toolbar set up in their particular browser. The company gather this data to be able to put together the actual rankings. Site owners usually make use of this info to compare sites and constantly like to see their ranking enhance.

Nevertheless, the Alexa website search positions tend to be mostly worthless for many reasons:

1.These people don’t depend with regard to anything. They don't go towards you’re your rankings online or are in fact employed for anything at all.

2.They are biased. Since the details are accumulated from users with all the toolbar put in, they're biased in the direction of web sites that are more often frequented simply by people that have the actual toolbar put in. Those with the particular plugin installed are more inclined to become highly focused or why not be the webmasters, and so the sorts of web site these people go to will certainly rank much better according to the Alexa rankings.

3.They're so easy to manipulate. Almost all the website owner needs to perform is actually install the particular toolbar in their internet browser and go to their own web site a few times per day to boost their particular The company position! (this really is typical carried out prior to selling a blog to unnaturally supply the impact the website will get more visitors laptop or computer truly does.

So to improve your The alexa company ranking, all you have to perform is put in the particular plugin (lounge chair somewhere, get a couple of pals to get it done as well) and also go to your website a few times a day!

The six Fundamental Components Of A Solid SEO Technique For Trusted Online Retailers

The six Fundamental Components Of A Solid SEO Technique For Trusted Online Retailers

One of the primary marketing and advertising techniques that can help online retailers build a effective Online business is actually search engine marketing (SEO), the process of creating your internet site to the algorithms that engines like Google utilize to position websites based on “signals” that the site produces.

Nonetheless, internet search engine calculations continue to alter as time passes as the Net grows (Panda Updates, anybody?), thus trusted online retailers have to develop using the search engines. We should make sure we all maintain up-to-date together with guidelines to claim the ideal rankings for relevant key phrases.
If you'd like your site to rate nicelywithin2012, listed below are half a dozen components of SEO that online retailers should know about when ever refining their e-commerce web site to position well inside top search engines like Google:
1)    Keywords. Keyword research will be the starting point to some effective SEO technique. The sesuccessful along with Search engine optimization determine what individuals are searching for when obtaining their particular company in a search results. These are the basic keywords they will use to operate vehicle targeted traffic for their items. Begin brain storming prospective key phrases, and see how a competition looks by utilizing Ad words Key phrase Instrument. You may notice which some keywords and phrases are far too competitive in your area of interest, go with long-tail keywords (in between two and also five words) which is easier to position. The longer the keyword, the actual significantly less opposition you’ll have to the expression inside the engines.

2)    Meta tags. Meta tags never the less perform a vital role in Search engine optimization. If you sort virtually any keyword right into a internet search engine, you’ll see how which search term will be shown within the name for that page. Yahoo looks at the web page identify like a transmission regarding meaning for that key phrase. The same holds correct for your outline of that site. (Don’t concern yourself with the search term name label-Search engines have openly said that that doesn’t pay attention to which label, as it continues to be abused simply by webmasters and many types of these attempting to get ranking for many keywords.)


3)    Content. It’s correct, submissions are full. Engines like Google have mentioned that creating top quality submissions are the easiest method to not just position for key phrases, but also create good consumer encounters. It will also greatly assist together with ensuring you’re training the customer, as well as an authority in your area of interest may results in boosts with in revenue.

4)    Back links. In the event that submissions are full, next back links are usually full. Remember, it’s not regarding which usually website has got the most hyperlinks; however who has the most top quality back links directing to their website. Build back links by distributing monthly or bi-monthly pr announcements about any kind of exciting company, and contacting well-known blogs inside your market to find out ways to interact to get a back link from their site. Produce the most beneficial product web site it is possible to, the reform folks talking about these products an individual market may link again. Try making graphics or newsworthy content material that will influence writers and also information internet sites to hyper link that articles.


5)    Social media. The particular algorithms possess really changed given that social media first surfaced. Numerous article sinter net sites are community-oriented –Delicious commenced permitting customers in order to election which tales increase the risk for top of the page, and Face book aspects opinions and also consumer rankings into their front page ratings. As a result, e-commerce stores need to establish a strong social networking reputation on sites just like MySpace, Pinterest, Face book, and so on. These kinds of social networking websites send engines like Google indicators regarding affect as well as authority.

6)    Product images. If you think images don’t play a role, reconsider that thought. Any time numerous customers look for goods in the search engines, they're not only exploring the “Web” results, yet they’re further more looking at the “images” outcomes. If you have quality pictures of that merchandise in your website--as well as the files’ brands include appropriate key phrases –these photos will certainly rank nicely browsing motors. This kind of opportunity will drive a lot of visitors to your website, since potential prospects will certainly selecting which graphic to find the store.
As well as perfecting all six of these aspects of your site, analyze the competition and see what they're performing with regards to on-page marketing, off-page marketing (aggressive hyperlink analysis) as well as social media marketing. While you may be doing a lot of exactly the same things they may be, it’s completely vital to think outside of the container to get a advantage on the competitors.

Top 10 Best WordPress SEO Plugins

Top 10 Best WordPress SEO Plugins


The World Wide Web is a huge place and most importantly it’s a home to some huge neighbor hood-the bloggers. If you are looking over this post, you may be part of that quick developing neighbor hood too. Nowadays there are more than one hundred seventy million weblogs from all around the world. Your blog might be excellent along with amazing and different content material but cont ending with which amount of bloggers is a difficult task.

So the query many bloggers request on their own eventually is actually “How do I stand out?”. Fortunately, that is not as difficult as you may think. Utilizing Word Press suggests that you have access to several free plugins you can use to your advantage. Listed here are the top ten:

1.      All in one SEO pack– The All in one SEO pack has got to be typically the most popular Word Press plugin out there and there's a reason for that. This particular word press plugin lets each and every blogger to easily write a Meta title, description as well as keywords for each publish therefore search engines can find this easier. Should you don’t possess the time to create a description for every post you can just use an ncargne rate done. You may also use a publish clip like a explanation if you can’t think of something unique. You may also use car produced keywords.

2.      No Follow Case by Case – This particular word press plugin enables writers to get rid of the no follow label its the comments. After that, we blog owners determine which comments will get the actual no follow feature and which of them won’t.

3.      Google XML Sitemaps – Many people think that just because the specific word press plugin includes “Google”, it is the just search engine that can browse the sitemaps. However, the actual plugin can create sitemaps that may be read through Ask, Yahoo and Windows live messenger search engines. Everybody who is into Search engine optimization know show essential sitemaps are to search engines like Google and when you want to end up being one step ahead of your competition, you need to use this plugin.

4.      SEO Blog roll – This particular word press plugin is especially useful when you want to split up hyper links in your blog roll in to sections and determine which of them can get the actual “no follow” tag. It's another helpful plugin which writers find really useful.

5.      SEO Rank Reporter – As everyone knows, monitoring out comes is among the most important aspects of SEO. This plugin enables you to track keywords and find out a report each and every 3 days. You may also end up being notified through e-mail whenever there is a substantial alternation in a keyword search positions.

6.      SEO Tag Cloud – Tag confuses are what some bloggers really hate plus some bloggers adore. Regardless of whether a person can’t remain tag clouds or simply adore have in gone on your blog, SEO Label Cloud is really a widget that will make your own tag cloud seasier for Google to see as well as index. It is definitely an essential golf widget through an SEO point of view.

7.      Automatic SEO Links– With this plugin you can pick a keyword you need to turn into a link to anchor-text. Basically, each time the actual plugin discovers the key phrase you would like, it'll make this the clickable hyperlink leading to any page you want. You may also arrange the link attribute. There is one big plus with this particular plugin. Let’s say you have a website on baby toys and you want the term “toys” to guide to another page. The word press plugin will discover this term making this a hyperlink and can bypass the rest of the “toys” words to prevent making several links directed towards the same task.

8.      Redirection – This plugin provides extensive functions. The most important one is it discovers of all of the 404 mistakes, fire log sell of them and enables you to map these to 301 redirects. By doing this you will not lose any search positions you might have on the pages you moved someplace else.

9.      SEO Friendly Images – Every one that claims to understand a minimum of a bit regarding Search engine optimization should know that image share also important for the search engines. Although Search engines can’t “see” pictures, it can never the less find out what they signify because of the alt label. Make use of this word press plugin to discover for those who have alternative and title labels on your pictures and if a person don’t –write them.
 
10.      Simple Tags – This particular plugin is very well-liked by bloggers and it basically can help you pick the best tags for your articles, auto complete themes you write and many more other things.

These ten plugins really are should have for every Search engine optimization conscious doodle kit who wish to stand out from your competition. Build your web log much more popular of computer already is or increase it's rankings for those who have just started. Now that you have the tools, the only thing left for you to do is actually use them.

Wednesday 25 September 2013

css tutorial

CSS Tutorial

What is CSS?

  • CSS stands for Cascading Style Sheets
  • Styles define how to display HTML elements
  • Styles were added to HTML 4.0 to solve a problem
  • External Style Sheets can save a lot of work
  • External Style Sheets are stored in CSS files

CSS Syntax

A CSS rule has two main parts: a selector, and one or more declarations:
http://www.w3schools.com/css/selector.gif
The selector is normally the HTML element you want to style.
Each declaration consists of a property and a value.
The property is the style attribute you want to change. Each property has a value.

CSS Example

A CSS declaration always ends with a semicolon, and declaration groups are surrounded by curly brackets:
p {color:red;text-align:center;}
To make the CSS more readable, you can put one declaration on each line, like this

CSS Comments

Comments are used to explain your code, and may help you when you edit the source code at a later date. Comments are ignored by browsers.
A CSS comment begins with "/*", and ends with "*/", like this:

CSS Id and Class

The id and class Selectors

In addition to setting a style for a HTML element, CSS allows you to specify your own selectors called "id" and "class".

The id Selector

The id selector is used to specify a style for a single, unique element.
The id selector uses the id attribute of the HTML element, and is defined with a "#".
The style rule below will be applied to the element with id="para1":

<!DOCTYPE html>

<html>

<head>

<style>

#para1

{

text-align:center;

color:red;

}

</style>

</head>

 

<body>

<p id="para1">Hello World!</p>

<p>This paragraph is not affected by the style.</p>

</body>

</html>

 The class Selector

The class selector is used to specify a style for a group of elements. Unlike the id selector, the class selector is most often used on several elements.
This allows you to set a particular style for many HTML elements with the same class.
The class selector uses the HTML class attribute, and is defined with a "."
In the example below, all HTML elements with class="center" will be center-aligned:

CSS How To...

When a browser reads a style sheet, it will format the document according to it.

Three Ways to Insert CSS

There are three ways of inserting a style sheet:
  • External style sheet
  • Internal style sheet
  • Inline style

External Style Sheet

An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the head section:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
An external style sheet can be written in any text editor. The file should not contain any html tags. Your style sheet should be saved with a .css extension. An example of a style sheet file is shown below:
hr {color:sienna;}
p {margin-left:20px;}
body {background-image:url("images/back40.gif");}
Remark Do not add a space between the property value and the unit (such as margin-left:20 px). The correct way is: margin-left:20px

Internal Style Sheet

An internal style sheet should be used when a single document has a unique style. You define internal styles in the head section of an HTML page, by using the <style> tag, like this:
<head>
<style>
hr {color:sienna;}
p {margin-left:20px;}
body {background-image:url("images/back40.gif");}
</style>
</head>


Inline Styles

An inline style loses many of the advantages of style sheets by mixing content with presentation. Use this method sparingly!
To use inline styles you use the style attribute in the relevant tag. The style attribute can contain any CSS property. The example shows how to change the color and the left margin of a paragraph:
<p style="color:sienna;margin-left:20px">This is a paragraph.</p>


Multiple Style Sheets

If some properties have been set for the same selector in different style sheets, the values will be inherited from the more specific style sheet. 
For example, an external style sheet has these properties for the h3 selector:
h3
{
color:red;
text-align:left;
font-size:8pt;
}
And an internal style sheet has these properties for the h3 selector:
h3
{
text-align:right;
font-size:20pt;
}
If the page with the internal style sheet also links to the external style sheet the properties for h3 will be:
color:red;
text-align:right;
font-size:20pt;
The color is inherited from the external style sheet and the text-alignment and the font-size is replaced by the internal style sheet.

Multiple Styles Will Cascade into One

Styles can be specified:
  • inside an HTML element
  • inside the head section of an HTML page
  • in an external CSS file
Tip: Even multiple external style sheets can be referenced inside a single HTML document.

Cascading order

What style will be used when there is more than one style specified for an HTML element?
Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority:
1.    Browser default
2.    External style sheet
3.    Internal style sheet (in the head section)
4.    Inline style (inside an HTML element)
So, an inline style (inside an HTML element) has the highest priority, which means that it will override a style defined inside the <head> tag, or in an external style sheet, or in a browser (a default value).

CSS Background

CSS background properties are used to define the background effects of an element.
CSS properties used for background effects:
  • background-color
  • background-image
  • background-repeat
  • background-attachment
  • background-position

Background Color

The background-color property specifies the background color of an element.
The background color of a page is defined in the body selector:

body {background-color:#b0c4de;}

h1 {background-color:#6495ed;}
p {background-color:#e0ffff;}
div {background-color:#b0c4de;}

Background Image

The background-image property specifies an image to use as the background of an element.
By default, the image is repeated so it covers the entire element.
The background image for a page can be set like this:

body {background-image:url('paper.gif');}

Background Image - Repeat Horizontally or Vertically

By default, the background-image property repeats an image both horizontally and vertically.
Some images should be repeated only horizontally or vertically, or they will look strange, like this: 

body
{
background-image:url('gradient2.png');
}

If the image is repeated only horizontally (repeat-x), the background will look better:

body
{
background-image:url('gradient2.png');
background-repeat:repeat-x;
}

Background Image - Set position and no-repeat

Remark When using a background image, use an image that does not disturb the text.
Showing the image only once is specified by the background-repeat property:

body
{
background-image:url('img_tree.png');
background-repeat:no-repeat;
}

In the example above, the background image is shown in the same place as the text. We want to change the position of the image, so that it does not disturb the text too much.
The position of the image is specified by the background-position property:

Example

body
{
background-image:url('img_tree.png');
background-repeat:no-repeat;
background-position:right top;
}

Text Color

The color property is used to set the color of the text.
With CSS, a color is most often specified by:
  • a HEX value - like "#ff0000"
  • an RGB value - like "rgb(255,0,0)"
  • a color name - like "red"

body {color:blue;}
h1 {color:#00ff00;}
h2 {color:rgb(255,0,0);}

Text Alignment

The text-align property is used to set the horizontal alignment of a text.
Text can be centered, or aligned to the left or right, or justified.
When text-align is set to "justify", each line is stretched so that every line has equal width, and the left and right margins are straight (like in magazines and newspapers).

h1 {text-align:center;}
p.date {text-align:right;}
p.main {text-align:justify;}

Text Decoration

The text-decoration property is used to set or remove decorations from text.
The text-decoration property is mostly used to remove underlines from links for design purposes:

 

a {text-decoration:none;}

h1 {text-decoration:overline;}
h2 {text-decoration:line-through;}
h3 {text-decoration:underline;}

Text Transformation

The text-transform property is used to specify uppercase and lowercase letters in a text.
It can be used to turn everything into uppercase or lowercase letters, or capitalize the first letter of each word.

 

p.uppercase {text-transform:uppercase;}
p.lowercase {text-transform:lowercase;}
p.capitalize {text-transform:capitalize;}

Use a Combination of Percent and Em

The solution that works in all browsers, is to set a default font-size in percent for the <body> element:

body {font-size:100%;}
h1 {font-size:2.5em;}
h2 {font-size:1.875em;}
p {font-size:0.875em;}

CSS Links

Links can be styled in different ways.

Styling Links

Links can be styled with any CSS property (e.g. color, font-family, background, etc.).
In addition, links can be styled differently depending on what state they are in.
The four links states are:
  • a:link - a normal, unvisited link
  • a:visited - a link the user has visited
  • a:hover - a link when the user mouses over it
  • a:active - a link the moment it is clicked

Example

a:link {color:#FF0000;}      /* unvisited link */
a:visited {color:#00FF00;}  /* visited link */
a:hover {color:#FF00FF;}  /* mouse over link */
a:active {color:#0000FF;}  /* selected link */

CSS Lists

The CSS list properties allow you to:
·         Set different list item markers for ordered lists
·         Set different list item markers for unordered lists
·         Set an image as the list item marker

List

In HTML, there are two types of lists:
  • unordered lists - the list items are marked with bullets
  • ordered lists - the list items are marked with numbers or letters
With CSS, lists can be styled further, and images can be used as the list item marker.

Different List Item Markers

The type of list item marker is specified with the list-style-type property:

<!DOCTYPE html>

<html>

<head>

<style>

ul.a {list-style-type:circle;}

ul.b {list-style-type:square;}

ol.c {list-style-type:upper-roman;}

ol.d {list-style-type:lower-alpha;}

</style>

</head>

 

<body>

<p>Example of unordered lists:</p>

 

<ul class="a">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ul>

 

<ul class="b">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ul>

 

<p>Example of ordered lists:</p>

 

<ol class="c">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ol>

 

<ol class="d">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ol>

 

</body>

</html>

…………………………………………………..

<!DOCTYPE html>

<html>

<head>

<style>

ul.a {list-style-type:circle;}

ul.b {list-style-type:square;}

ol.c {list-style-type:upper-roman;}

ol.d {list-style-type:lower-alpha;}

</style>

</head>

 

<body>

<p>Example of unordered lists:</p>

 

<ul class="a">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ul>

 

<ul class="b">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ul>

 

<p>Example of ordered lists:</p>

 

<ol class="c">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ol>

 

<ol class="d">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ol>

 

</body>

</html>

 

CSS Box Model

The CSS Box Model

All HTML elements can be considered as boxes. In CSS, the term "box model" is used when talking about design and layout.
The CSS box model is essentially a box that wraps around HTML elements, and it consists of: margins, borders, padding, and the actual content.
The box model allows us to place a border around elements and space elements in relation to other elements.
The image below illustrates the box model:


CSS box-model

Explanation of the different parts:
  • Margin - Clears an area around the border. The margin does not have a background color, it is completely transparent
  • Border - A border that goes around the padding and content. The border is affected by the background color of the box
  • Padding - Clears an area around the content. The padding is affected by the background color of the box
  • Content - The content of the box, where text and images appear
In order to set the width and height of an element correctly in all browsers, you need to know how the box model works.

Width and Height of an Element

Remark Important: When you set the width and height properties of an element with CSS, you just set the width and height of the content area. To calculate the full size of an element, you must also add the padding, borders and margins.
The total width of the element in the example below is 300px:
width:250px;
padding:10px;
border:5px solid gray;
margin:10px;
Let's do the math:
250px (width)
+ 20px (left + right padding)
+ 10px (left + right border)
+ 20px (left + right margin)
= 300px
Assume that you had only 250px of space. Let's make an element with a total width of 250px:

<!DOCTYPE html>

<html>

<head>

<style>

div.ex

{

width:220px;

padding:10px;

border:5px solid gray;

margin:0px;

}

</style>

</head>

 

<body>

 

<img src="w3css.gif" width="250" height="250" />

 

<div class="ex">The picture above is 250px wide.

The total width of this element is also 250px.</div>

 

</body>

</html>

…………………………

The total width of an element should be calculated like this:
Total element width = width + left padding + right padding + left border + right border + left margin + right margin
The total height of an element should be calculated like this:
Total element height = height + top padding + bottom padding + top border + bottom border + top margin + bottom margin

CSS Border

CSS Border


CSS Border Properties

The CSS border properties allow you to specify the style and color of an element's border.

Border Style

The border-style property specifies what kind of border to display.
Remark None of the border properties will have ANY effect unless the border-style property is set!

border-style values:

none: Defines no border
dotted: Defines a dotted border
dashed: Defines a dashed border
solid: Defines a solid border
double: Defines two borders. The width of the two borders are the same as the border-width value
groove: Defines a 3D grooved border. The effect depends on the border-color value
ridge: Defines a 3D ridged border. The effect depends on the border-color value
inset: Defines a 3D inset border. The effect depends on the border-color value
outset: Defines a 3D outset border. The effect depends on the border-color value
Try it yourself: Set the style of the border

Border Width

The border-width property is used to set the width of the border.
The width is set in pixels, or by using one of the three pre-defined values: thin, medium, or thick.
Note: The "border-width" property does not work if it is used alone. Use the "border-style" property to set the borders first.

Example

p.one
{
border-style:solid;
border-width:5px;
}
p.two
{
border-style:solid;
border-width:medium;
}


Border Color

The border-color property is used to set the color of the border. The color can be set by:
  • name - specify a color name, like "red"
  • RGB - specify a RGB value, like "rgb(255,0,0)"
  • Hex - specify a hex value, like "#ff0000"
You can also set the border color to "transparent".
Note: The "border-color" property does not work if it is used alone. Use the "border-style" property to set the borders first.

Example

p.one
{
border-style:solid;
border-color:red;
}
p.two
{
border-style:solid;
border-color:#98bf21;
}


Border - Individual sides

In CSS it is possible to specify different borders for different sides:

Example

p
{
border-top-style:dotted;
border-right-style:solid;
border-bottom-style:dotted;
border-left-style:solid;
}
The example above can also be set with a single property:

Example

border-style:dotted solid;
The border-style property can have from one to four values.
  • border-style:dotted solid double dashed;
    • top border is dotted
    • right border is solid
    • bottom border is double
    • left border is dashed

  • border-style:dotted solid double;
    • top border is dotted
    • right and left borders are solid
    • bottom border is double

  • border-style:dotted solid;
    • top and bottom borders are dotted
    • right and left borders are solid

  • border-style:dotted;
    • all four borders are dotted
The border-style property is used in the example above. However, it also works with border-width and border-color.

Border - Shorthand property

As you can see from the examples above, there are many properties to consider when dealing with borders.
To shorten the code, it is also possible to specify all the individual border properties in one property. This is called a shorthand property.
The border property is a shorthand for the following individual border properties:
  • border-width
  • border-style (required)
  • border-color

Example

border:5px solid red;

CSS Outlines

An outline is a line that is drawn around elements (outside the borders) to make the element "stand out".
The outline properties specify the style, color, and width of an outline.

CSS Outline

An outline is a line that is drawn around elements (outside the borders) to make the element "stand out".
However, the outline property is different from the border property.
The outline is not a part of an element's dimensions; the element's total width and height is not affected by the width of the outline.
Outline 

CSS Margin

The CSS margin properties define the space around elements.

Margin

The margin clears an area around an element (outside the border). The margin does not have a background color, and is completely transparent.
The top, right, bottom, and left margin can be changed independently using separate properties. A shorthand margin property can also be used, to change all margins at once.

Possible Values

Value
Description
auto
The browser calculates a margin
length
Specifies a margin in px, pt, cm, etc. Default value is 0px
%
Specifies a margin in percent of the width of the containing element
inherit
Specifies that the margin should be inherited from the parent element
Remark It is possible to use negative values, to overlap content.

Margin - Individual sides

In CSS, it is possible to specify different margins for different sides:

Example

margin-top:100px;
margin-bottom:100px;
margin-right:50px;
margin-left:50px;


Margin - Shorthand property

To shorten the code, it is possible to specify all the margin properties in one property. This is called a shorthand property.
The shorthand property for all the margin properties is "margin":

Example

margin:100px 50px;
The margin property can have from one to four values.
  • margin:25px 50px 75px 100px;
    • top margin is 25px
    • right margin is 50px
    • bottom margin is 75px
    • left margin is 100px

  • margin:25px 50px 75px;
    • top margin is 25px
    • right and left margins are 50px
    • bottom margin is 75px

  • margin:25px 50px;
    • top and bottom margins are 25px
    • right and left margins are 50px

  • margin:25px;
    • all four margins are 25px

CSS Padding

The CSS padding properties define the space between the element border and the element content.

Padding

The padding clears an area around the content (inside the border) of an element. The padding is affected by the background color of the element.
The top, right, bottom, and left padding can be changed independently using separate properties. A shorthand padding property can also be used, to change all paddings at once.

Possible Values

Value
Description
length
Defines a fixed padding (in pixels, pt, em, etc.)
%
Defines a padding in % of the containing element


Padding - Individual sides

In CSS, it is possible to specify different padding for different sides:

Example

padding-top:25px;
padding-bottom:25px;
padding-right:50px;
padding-left:50px;


Padding - Shorthand property

To shorten the code, it is possible to specify all the padding properties in one property. This is called a shorthand property.
The shorthand property for all the padding properties is "padding":

Example

padding:25px 50px;
The padding property can have from one to four values.
  • padding:25px 50px 75px 100px;
    • top padding is 25px
    • right padding is 50px
    • bottom padding is 75px
    • left padding is 100px

  • padding:25px 50px 75px;
    • top padding is 25px
    • right and left paddings are 50px
    • bottom padding is 75px

  • padding:25px 50px;
    • top and bottom paddings are 25px
    • right and left paddings are 50px

  • padding:25px;
    • all four paddings are 25px

CSS Grouping and Nesting Selectors

Grouping Selectors

In style sheets there are often elements with the same style.
h1
{
color:green;
}
h2
{
color:green;
}
p
{
color:green;
}
To minimize the code, you can group selectors.
Separate each selector with a comma.
In the example below we have grouped the selectors from the code above:
h1,h2,p
{
color:green;
}

Nesting Selectors

It is possible to apply a style for a selector within a selector.
In the example below, one style is specified for all p elements, one style is specified for all elements with class="marked", and a third style is specified only for p elements within elements with class="marked":

Example

p
{
color:blue;
text-align:center;
}
.marked
{
background-color:red;
}
.marked p
{
color:white;
}

Positioning

The CSS positioning properties allow you to position an element. It can also place an element behind another, and specify what should happen when an element's content is too big.
Elements can be positioned using the top, bottom, left, and right properties. However, these properties will not work unless the position property is set first. They also work differently depending on the positioning method.
There are four different positioning methods.

Static Positioning

HTML elements are positioned static by default. A static positioned element is always positioned according to the normal flow of the page.
Static positioned elements are not affected by the top, bottom, left, and right properties.

Fixed Positioning

An element with fixed position is positioned relative to the browser window.
It will not move even if the window is scrolled:
p.pos_fixed
{
position:fixed;
top:30px;
right:5px;
}

Relative Positioning

A relative positioned element is positioned relative to its normal position.

Example

h2.pos_left
{
position:relative;
left:-20px;
}
h2.pos_right
{
position:relative;
left:20px;
}
The content of relatively positioned elements can be moved and overlap other elements, but the reserved space for the element is still preserved in the normal flow.

Example

h2.pos_top
{
position:relative;
top:-50px;
}
Relatively positioned elements are often used as container blocks for absolutely positioned elements.

Absolute Positioning

An absolute position element is positioned relative to the first parent element that has a position other than static. If no such element is found, the containing block is <html>:

Example

h2
{
position:absolute;
left:100px;
top:150px;
}
Absolutely positioned elements are removed from the normal flow. The document and other elements behave like the absolutely positioned element does not exist.
Absolutely positioned elements can overlap other elements.

Overlapping Elements

When elements are positioned outside the normal flow, they can overlap other elements.
The z-index property specifies the stack order of an element (which element should be placed in front of, or behind, the others).
An element can have a positive or negative stack order:

Example

img
{
position:absolute;
left:0px;
top:0px;
z-index:-1;
}

CSS Horizontal Align

Aligning Block Elements

A block element is an element that takes up the full width available, and has a line break before and after it.
Examples of block elements:
  • <h1>
  • <p>
  • <div>
For aligning text, see the CSS Text chapter.
In this chapter we will show you how to horizontally align block elements for layout purposes.

Center Aligning Using the margin Property

Block elements can be aligned by setting the left and right margins to "auto".
Note: Using margin:auto will not work in IE8 and earlier, unless a !DOCTYPE is declared.
Setting the left and right margins to auto specifies that they should split the available margin equally. The result is a centered element:

Example

.center
{
margin-left:auto;
margin-right:auto;
width:70%;
background-color:#b0e0e6;
}
Tip: Aligning has no effect if the width is 100%.
Note: In IE5 there is a margin handling bug for block elements. To make the example above work in IE5, add some extra code. Try it yourself

Left and Right Aligning Using the position Property

One method of aligning elements is to use absolute positioning:

Example

.right
{
position:absolute;
right:0px;
width:300px;
background-color:#b0e0e6;
}
Note: Absolute positioned elements are removed from the normal flow, and can overlap elements.

Crossbrowser Compatibility Issues

When aligning elements like this, it is always a good idea to predefine margin and padding for the <body> element. This is to avoid visual differences in different browsers.
There is a problem with IE8 and earlier, when using the position property. If a container element (in our case <div class="container">) has a specified width, and the !DOCTYPE declaration is missing, IE8 and earlier versions will add a 17px margin on the right side. This seems to be space reserved for a scrollbar. Always set the !DOCTYPE declaration when using the position property:

Example

body
{
margin:0;
padding:0;
}
.container
{
position:relative;
width:100%;
}
.right
{
position:absolute;
right:0px;
width:300px;
background-color:#b0e0e6;
}


Left and Right Aligning Using the float Property

One method of aligning elements is to use the float property:

Example

.right
{
float:right;
width:300px;
background-color:#b0e0e6;
}


Crossbrowser Compatibility Issues

When aligning elements like this, it is always a good idea to predefine margin and padding for the <body> element. This is to avoid visual differences in different browsers.
There is a problem with IE8 and earlier when using the float property. If the !DOCTYPE declaration is missing, IE8 and earlier versions will add a 17px margin on the right side. This seems to be space reserved for a scrollbar. Always set the !DOCTYPE declaration when using the float property:

Example

body
{
margin:0;
padding:0;
}
.right
{
float:right;
width:300px;
background-color:#
CSS Tutorial

What is CSS?

  • CSS stands for Cascading Style Sheets
  • Styles define how to display HTML elements
  • Styles were added to HTML 4.0 to solve a problem
  • External Style Sheets can save a lot of work
  • External Style Sheets are stored in CSS files

CSS Syntax

A CSS rule has two main parts: a selector, and one or more declarations:
http://www.w3schools.com/css/selector.gif
The selector is normally the HTML element you want to style.
Each declaration consists of a property and a value.
The property is the style attribute you want to change. Each property has a value.

CSS Example

A CSS declaration always ends with a semicolon, and declaration groups are surrounded by curly brackets:
p {color:red;text-align:center;}
To make the CSS more readable, you can put one declaration on each line, like this

CSS Comments

Comments are used to explain your code, and may help you when you edit the source code at a later date. Comments are ignored by browsers.
A CSS comment begins with "/*", and ends with "*/", like this:

CSS Id and Class

The id and class Selectors

In addition to setting a style for a HTML element, CSS allows you to specify your own selectors called "id" and "class".

The id Selector

The id selector is used to specify a style for a single, unique element.
The id selector uses the id attribute of the HTML element, and is defined with a "#".
The style rule below will be applied to the element with id="para1":

<!DOCTYPE html>

<html>

<head>

<style>

#para1

{

text-align:center;

color:red;

}

</style>

</head>

 

<body>

<p id="para1">Hello World!</p>

<p>This paragraph is not affected by the style.</p>

</body>

</html>

 The class Selector

The class selector is used to specify a style for a group of elements. Unlike the id selector, the class selector is most often used on several elements.
This allows you to set a particular style for many HTML elements with the same class.
The class selector uses the HTML class attribute, and is defined with a "."
In the example below, all HTML elements with class="center" will be center-aligned:

CSS How To...

When a browser reads a style sheet, it will format the document according to it.

Three Ways to Insert CSS

There are three ways of inserting a style sheet:
  • External style sheet
  • Internal style sheet
  • Inline style

External Style Sheet

An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. Each page must link to the style sheet using the <link> tag. The <link> tag goes inside the head section:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
An external style sheet can be written in any text editor. The file should not contain any html tags. Your style sheet should be saved with a .css extension. An example of a style sheet file is shown below:
hr {color:sienna;}
p {margin-left:20px;}
body {background-image:url("images/back40.gif");}
Remark Do not add a space between the property value and the unit (such as margin-left:20 px). The correct way is: margin-left:20px

Internal Style Sheet

An internal style sheet should be used when a single document has a unique style. You define internal styles in the head section of an HTML page, by using the <style> tag, like this:
<head>
<style>
hr {color:sienna;}
p {margin-left:20px;}
body {background-image:url("images/back40.gif");}
</style>
</head>


Inline Styles

An inline style loses many of the advantages of style sheets by mixing content with presentation. Use this method sparingly!
To use inline styles you use the style attribute in the relevant tag. The style attribute can contain any CSS property. The example shows how to change the color and the left margin of a paragraph:
<p style="color:sienna;margin-left:20px">This is a paragraph.</p>


Multiple Style Sheets

If some properties have been set for the same selector in different style sheets, the values will be inherited from the more specific style sheet. 
For example, an external style sheet has these properties for the h3 selector:
h3
{
color:red;
text-align:left;
font-size:8pt;
}
And an internal style sheet has these properties for the h3 selector:
h3
{
text-align:right;
font-size:20pt;
}
If the page with the internal style sheet also links to the external style sheet the properties for h3 will be:
color:red;
text-align:right;
font-size:20pt;
The color is inherited from the external style sheet and the text-alignment and the font-size is replaced by the internal style sheet.

Multiple Styles Will Cascade into One

Styles can be specified:
  • inside an HTML element
  • inside the head section of an HTML page
  • in an external CSS file
Tip: Even multiple external style sheets can be referenced inside a single HTML document.

Cascading order

What style will be used when there is more than one style specified for an HTML element?
Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority:
1.    Browser default
2.    External style sheet
3.    Internal style sheet (in the head section)
4.    Inline style (inside an HTML element)
So, an inline style (inside an HTML element) has the highest priority, which means that it will override a style defined inside the <head> tag, or in an external style sheet, or in a browser (a default value).

CSS Background

CSS background properties are used to define the background effects of an element.
CSS properties used for background effects:
  • background-color
  • background-image
  • background-repeat
  • background-attachment
  • background-position

Background Color

The background-color property specifies the background color of an element.
The background color of a page is defined in the body selector:

body {background-color:#b0c4de;}

h1 {background-color:#6495ed;}
p {background-color:#e0ffff;}
div {background-color:#b0c4de;}

Background Image

The background-image property specifies an image to use as the background of an element.
By default, the image is repeated so it covers the entire element.
The background image for a page can be set like this:

body {background-image:url('paper.gif');}

Background Image - Repeat Horizontally or Vertically

By default, the background-image property repeats an image both horizontally and vertically.
Some images should be repeated only horizontally or vertically, or they will look strange, like this: 

body
{
background-image:url('gradient2.png');
}

If the image is repeated only horizontally (repeat-x), the background will look better:

body
{
background-image:url('gradient2.png');
background-repeat:repeat-x;
}

Background Image - Set position and no-repeat

Remark When using a background image, use an image that does not disturb the text.
Showing the image only once is specified by the background-repeat property:

body
{
background-image:url('img_tree.png');
background-repeat:no-repeat;
}

In the example above, the background image is shown in the same place as the text. We want to change the position of the image, so that it does not disturb the text too much.
The position of the image is specified by the background-position property:

Example

body
{
background-image:url('img_tree.png');
background-repeat:no-repeat;
background-position:right top;
}

Text Color

The color property is used to set the color of the text.
With CSS, a color is most often specified by:
  • a HEX value - like "#ff0000"
  • an RGB value - like "rgb(255,0,0)"
  • a color name - like "red"

body {color:blue;}
h1 {color:#00ff00;}
h2 {color:rgb(255,0,0);}

Text Alignment

The text-align property is used to set the horizontal alignment of a text.
Text can be centered, or aligned to the left or right, or justified.
When text-align is set to "justify", each line is stretched so that every line has equal width, and the left and right margins are straight (like in magazines and newspapers).

h1 {text-align:center;}
p.date {text-align:right;}
p.main {text-align:justify;}

Text Decoration

The text-decoration property is used to set or remove decorations from text.
The text-decoration property is mostly used to remove underlines from links for design purposes:

 

a {text-decoration:none;}

h1 {text-decoration:overline;}
h2 {text-decoration:line-through;}
h3 {text-decoration:underline;}

Text Transformation

The text-transform property is used to specify uppercase and lowercase letters in a text.
It can be used to turn everything into uppercase or lowercase letters, or capitalize the first letter of each word.

 

p.uppercase {text-transform:uppercase;}
p.lowercase {text-transform:lowercase;}
p.capitalize {text-transform:capitalize;}

Use a Combination of Percent and Em

The solution that works in all browsers, is to set a default font-size in percent for the <body> element:

body {font-size:100%;}
h1 {font-size:2.5em;}
h2 {font-size:1.875em;}
p {font-size:0.875em;}

CSS Links

Links can be styled in different ways.

Styling Links

Links can be styled with any CSS property (e.g. color, font-family, background, etc.).
In addition, links can be styled differently depending on what state they are in.
The four links states are:
  • a:link - a normal, unvisited link
  • a:visited - a link the user has visited
  • a:hover - a link when the user mouses over it
  • a:active - a link the moment it is clicked

Example

a:link {color:#FF0000;}      /* unvisited link */
a:visited {color:#00FF00;}  /* visited link */
a:hover {color:#FF00FF;}  /* mouse over link */
a:active {color:#0000FF;}  /* selected link */

CSS Lists

The CSS list properties allow you to:
·         Set different list item markers for ordered lists
·         Set different list item markers for unordered lists
·         Set an image as the list item marker

List

In HTML, there are two types of lists:
  • unordered lists - the list items are marked with bullets
  • ordered lists - the list items are marked with numbers or letters
With CSS, lists can be styled further, and images can be used as the list item marker.

Different List Item Markers

The type of list item marker is specified with the list-style-type property:

<!DOCTYPE html>

<html>

<head>

<style>

ul.a {list-style-type:circle;}

ul.b {list-style-type:square;}

ol.c {list-style-type:upper-roman;}

ol.d {list-style-type:lower-alpha;}

</style>

</head>

 

<body>

<p>Example of unordered lists:</p>

 

<ul class="a">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ul>

 

<ul class="b">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ul>

 

<p>Example of ordered lists:</p>

 

<ol class="c">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ol>

 

<ol class="d">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ol>

 

</body>

</html>

…………………………………………………..

<!DOCTYPE html>

<html>

<head>

<style>

ul.a {list-style-type:circle;}

ul.b {list-style-type:square;}

ol.c {list-style-type:upper-roman;}

ol.d {list-style-type:lower-alpha;}

</style>

</head>

 

<body>

<p>Example of unordered lists:</p>

 

<ul class="a">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ul>

 

<ul class="b">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ul>

 

<p>Example of ordered lists:</p>

 

<ol class="c">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ol>

 

<ol class="d">

  <li>Coffee</li>

  <li>Tea</li>

  <li>Coca Cola</li>

</ol>

 

</body>

</html>

 

CSS Box Model

The CSS Box Model

All HTML elements can be considered as boxes. In CSS, the term "box model" is used when talking about design and layout.
The CSS box model is essentially a box that wraps around HTML elements, and it consists of: margins, borders, padding, and the actual content.
The box model allows us to place a border around elements and space elements in relation to other elements.
The image below illustrates the box model:


CSS box-model

Explanation of the different parts:
  • Margin - Clears an area around the border. The margin does not have a background color, it is completely transparent
  • Border - A border that goes around the padding and content. The border is affected by the background color of the box
  • Padding - Clears an area around the content. The padding is affected by the background color of the box
  • Content - The content of the box, where text and images appear
In order to set the width and height of an element correctly in all browsers, you need to know how the box model works.

Width and Height of an Element

Remark Important: When you set the width and height properties of an element with CSS, you just set the width and height of the content area. To calculate the full size of an element, you must also add the padding, borders and margins.
The total width of the element in the example below is 300px:
width:250px;
padding:10px;
border:5px solid gray;
margin:10px;
Let's do the math:
250px (width)
+ 20px (left + right padding)
+ 10px (left + right border)
+ 20px (left + right margin)
= 300px
Assume that you had only 250px of space. Let's make an element with a total width of 250px:

<!DOCTYPE html>

<html>

<head>

<style>

div.ex

{

width:220px;

padding:10px;

border:5px solid gray;

margin:0px;

}

</style>

</head>

 

<body>

 

<img src="w3css.gif" width="250" height="250" />

 

<div class="ex">The picture above is 250px wide.

The total width of this element is also 250px.</div>

 

</body>

</html>

…………………………

The total width of an element should be calculated like this:
Total element width = width + left padding + right padding + left border + right border + left margin + right margin
The total height of an element should be calculated like this:
Total element height = height + top padding + bottom padding + top border + bottom border + top margin + bottom margin

CSS Border

CSS Border


CSS Border Properties

The CSS border properties allow you to specify the style and color of an element's border.

Border Style

The border-style property specifies what kind of border to display.
Remark None of the border properties will have ANY effect unless the border-style property is set!

border-style values:

none: Defines no border
dotted: Defines a dotted border
dashed: Defines a dashed border
solid: Defines a solid border
double: Defines two borders. The width of the two borders are the same as the border-width value
groove: Defines a 3D grooved border. The effect depends on the border-color value
ridge: Defines a 3D ridged border. The effect depends on the border-color value
inset: Defines a 3D inset border. The effect depends on the border-color value
outset: Defines a 3D outset border. The effect depends on the border-color value
Try it yourself: Set the style of the border

Border Width

The border-width property is used to set the width of the border.
The width is set in pixels, or by using one of the three pre-defined values: thin, medium, or thick.
Note: The "border-width" property does not work if it is used alone. Use the "border-style" property to set the borders first.

Example

p.one
{
border-style:solid;
border-width:5px;
}
p.two
{
border-style:solid;
border-width:medium;
}


Border Color

The border-color property is used to set the color of the border. The color can be set by:
  • name - specify a color name, like "red"
  • RGB - specify a RGB value, like "rgb(255,0,0)"
  • Hex - specify a hex value, like "#ff0000"
You can also set the border color to "transparent".
Note: The "border-color" property does not work if it is used alone. Use the "border-style" property to set the borders first.

Example

p.one
{
border-style:solid;
border-color:red;
}
p.two
{
border-style:solid;
border-color:#98bf21;
}


Border - Individual sides

In CSS it is possible to specify different borders for different sides:

Example

p
{
border-top-style:dotted;
border-right-style:solid;
border-bottom-style:dotted;
border-left-style:solid;
}
The example above can also be set with a single property:

Example

border-style:dotted solid;
The border-style property can have from one to four values.
  • border-style:dotted solid double dashed;
    • top border is dotted
    • right border is solid
    • bottom border is double
    • left border is dashed

  • border-style:dotted solid double;
    • top border is dotted
    • right and left borders are solid
    • bottom border is double

  • border-style:dotted solid;
    • top and bottom borders are dotted
    • right and left borders are solid

  • border-style:dotted;
    • all four borders are dotted
The border-style property is used in the example above. However, it also works with border-width and border-color.

Border - Shorthand property

As you can see from the examples above, there are many properties to consider when dealing with borders.
To shorten the code, it is also possible to specify all the individual border properties in one property. This is called a shorthand property.
The border property is a shorthand for the following individual border properties:
  • border-width
  • border-style (required)
  • border-color

Example

border:5px solid red;

CSS Outlines

An outline is a line that is drawn around elements (outside the borders) to make the element "stand out".
The outline properties specify the style, color, and width of an outline.

CSS Outline

An outline is a line that is drawn around elements (outside the borders) to make the element "stand out".
However, the outline property is different from the border property.
The outline is not a part of an element's dimensions; the element's total width and height is not affected by the width of the outline.
Outline 

CSS Margin

The CSS margin properties define the space around elements.

Margin

The margin clears an area around an element (outside the border). The margin does not have a background color, and is completely transparent.
The top, right, bottom, and left margin can be changed independently using separate properties. A shorthand margin property can also be used, to change all margins at once.

Possible Values

Value
Description
auto
The browser calculates a margin
length
Specifies a margin in px, pt, cm, etc. Default value is 0px
%
Specifies a margin in percent of the width of the containing element
inherit
Specifies that the margin should be inherited from the parent element
Remark It is possible to use negative values, to overlap content.

Margin - Individual sides

In CSS, it is possible to specify different margins for different sides:

Example

margin-top:100px;
margin-bottom:100px;
margin-right:50px;
margin-left:50px;


Margin - Shorthand property

To shorten the code, it is possible to specify all the margin properties in one property. This is called a shorthand property.
The shorthand property for all the margin properties is "margin":

Example

margin:100px 50px;
The margin property can have from one to four values.
  • margin:25px 50px 75px 100px;
    • top margin is 25px
    • right margin is 50px
    • bottom margin is 75px
    • left margin is 100px

  • margin:25px 50px 75px;
    • top margin is 25px
    • right and left margins are 50px
    • bottom margin is 75px

  • margin:25px 50px;
    • top and bottom margins are 25px
    • right and left margins are 50px

  • margin:25px;
    • all four margins are 25px

CSS Padding

The CSS padding properties define the space between the element border and the element content.

Padding

The padding clears an area around the content (inside the border) of an element. The padding is affected by the background color of the element.
The top, right, bottom, and left padding can be changed independently using separate properties. A shorthand padding property can also be used, to change all paddings at once.

Possible Values

Value
Description
length
Defines a fixed padding (in pixels, pt, em, etc.)
%
Defines a padding in % of the containing element


Padding - Individual sides

In CSS, it is possible to specify different padding for different sides:

Example

padding-top:25px;
padding-bottom:25px;
padding-right:50px;
padding-left:50px;


Padding - Shorthand property

To shorten the code, it is possible to specify all the padding properties in one property. This is called a shorthand property.
The shorthand property for all the padding properties is "padding":

Example

padding:25px 50px;
The padding property can have from one to four values.
  • padding:25px 50px 75px 100px;
    • top padding is 25px
    • right padding is 50px
    • bottom padding is 75px
    • left padding is 100px

  • padding:25px 50px 75px;
    • top padding is 25px
    • right and left paddings are 50px
    • bottom padding is 75px

  • padding:25px 50px;
    • top and bottom paddings are 25px
    • right and left paddings are 50px

  • padding:25px;
    • all four paddings are 25px

CSS Grouping and Nesting Selectors

Grouping Selectors

In style sheets there are often elements with the same style.
h1
{
color:green;
}
h2
{
color:green;
}
p
{
color:green;
}
To minimize the code, you can group selectors.
Separate each selector with a comma.
In the example below we have grouped the selectors from the code above:
h1,h2,p
{
color:green;
}

Nesting Selectors

It is possible to apply a style for a selector within a selector.
In the example below, one style is specified for all p elements, one style is specified for all elements with class="marked", and a third style is specified only for p elements within elements with class="marked":

Example

p
{
color:blue;
text-align:center;
}
.marked
{
background-color:red;
}
.marked p
{
color:white;
}

Positioning

The CSS positioning properties allow you to position an element. It can also place an element behind another, and specify what should happen when an element's content is too big.
Elements can be positioned using the top, bottom, left, and right properties. However, these properties will not work unless the position property is set first. They also work differently depending on the positioning method.
There are four different positioning methods.

Static Positioning

HTML elements are positioned static by default. A static positioned element is always positioned according to the normal flow of the page.
Static positioned elements are not affected by the top, bottom, left, and right properties.

Fixed Positioning

An element with fixed position is positioned relative to the browser window.
It will not move even if the window is scrolled:
p.pos_fixed
{
position:fixed;
top:30px;
right:5px;
}

Relative Positioning

A relative positioned element is positioned relative to its normal position.

Example

h2.pos_left
{
position:relative;
left:-20px;
}
h2.pos_right
{
position:relative;
left:20px;
}
The content of relatively positioned elements can be moved and overlap other elements, but the reserved space for the element is still preserved in the normal flow.

Example

h2.pos_top
{
position:relative;
top:-50px;
}
Relatively positioned elements are often used as container blocks for absolutely positioned elements.

Absolute Positioning

An absolute position element is positioned relative to the first parent element that has a position other than static. If no such element is found, the containing block is <html>:

Example

h2
{
position:absolute;
left:100px;
top:150px;
}
Absolutely positioned elements are removed from the normal flow. The document and other elements behave like the absolutely positioned element does not exist.
Absolutely positioned elements can overlap other elements.

Overlapping Elements

When elements are positioned outside the normal flow, they can overlap other elements.
The z-index property specifies the stack order of an element (which element should be placed in front of, or behind, the others).
An element can have a positive or negative stack order:

Example

img
{
position:absolute;
left:0px;
top:0px;
z-index:-1;
}

CSS Horizontal Align

Aligning Block Elements

A block element is an element that takes up the full width available, and has a line break before and after it.
Examples of block elements:
  • <h1>
  • <p>
  • <div>
For aligning text, see the CSS Text chapter.
In this chapter we will show you how to horizontally align block elements for layout purposes.

Center Aligning Using the margin Property

Block elements can be aligned by setting the left and right margins to "auto".
Note: Using margin:auto will not work in IE8 and earlier, unless a !DOCTYPE is declared.
Setting the left and right margins to auto specifies that they should split the available margin equally. The result is a centered element:

Example

.center
{
margin-left:auto;
margin-right:auto;
width:70%;
background-color:#b0e0e6;
}
Tip: Aligning has no effect if the width is 100%.
Note: In IE5 there is a margin handling bug for block elements. To make the example above work in IE5, add some extra code. Try it yourself

Left and Right Aligning Using the position Property

One method of aligning elements is to use absolute positioning:

Example

.right
{
position:absolute;
right:0px;
width:300px;
background-color:#b0e0e6;
}
Note: Absolute positioned elements are removed from the normal flow, and can overlap elements.

Crossbrowser Compatibility Issues

When aligning elements like this, it is always a good idea to predefine margin and padding for the <body> element. This is to avoid visual differences in different browsers.
There is a problem with IE8 and earlier, when using the position property. If a container element (in our case <div class="container">) has a specified width, and the !DOCTYPE declaration is missing, IE8 and earlier versions will add a 17px margin on the right side. This seems to be space reserved for a scrollbar. Always set the !DOCTYPE declaration when using the position property:

Example

body
{
margin:0;
padding:0;
}
.container
{
position:relative;
width:100%;
}
.right
{
position:absolute;
right:0px;
width:300px;
background-color:#b0e0e6;
}


Left and Right Aligning Using the float Property

One method of aligning elements is to use the float property:

Example

.right
{
float:right;
width:300px;
background-color:#b0e0e6;
}


Crossbrowser Compatibility Issues

When aligning elements like this, it is always a good idea to predefine margin and padding for the <body> element. This is to avoid visual differences in different browsers.
There is a problem with IE8 and earlier when using the float property. If the !DOCTYPE declaration is missing, IE8 and earlier versions will add a 17px margin on the right side. This seems to be space reserved for a scrollbar. Always set the !DOCTYPE declaration when using the float property:

Example

body
{
margin:0;
padding:0;
}
.right
{
float:right;
width:300px;
background-color:#b0e0e6;
}



 


 ;
}



 



Featured post

Life Infotech now a leading brand in the field of technology training

  Life Infotech now a leading brand in the field of technology training & its invites students around the nation to be a part of the Tra...