• Using .htaccess Effectively

    Date: 2011.02.24 | Category: WebDesign | Response: 0

    The .htaccess file is an ASCII text document that can be placed in any directory on your site. It can be used to control access to files and directories, and customize some server operation in your site. A .htaccess file can be created in any word processor but must be saved as text only. You must use FTP software in ASCII mode to upload or edit your .htaccess file. For the examples provided here, place the .htaccess file in your root directory.

    There are a variety of functions that you can control using .htaccess some of the more useful of these are explained below:

    Custom Error Messages.

    Add the following to the .htaccess file::

    ErrorDocument 404 /notfound.html

    After “ErrorDocument” specify the error code, followed by a space, and then the path and filename of the .html file you would like to be displayed when the specified error is generated, each specific error code is detailed below with the recommended codes to be used in the .htaccess file in bold :

    200 OK
    206 Partial content
    301 Document moved permanently
    302 Document found elsewhere
    304 Not modified since last retrieval
    400 Bad request
    403 Access forbidden
    404 Document not found
    408 Request timeout
    500 Internal server error
    501 Request type not supported

    Using the codes above your error section of the .htaccess file should look like this:

    ErrorDocument 301 /notfound.html
    ErrorDocument 400 /notfound.html
    ErrorDocument 403 /notfound.html
    ErrorDocument 404 /notfound.html
    ErrorDocument 500 /notfound.html
    ErrorDocument 501 /notfound.html

    Redirect to a Different Folder.

    Add the following to the .htaccess file:

    RewriteEngine on
    RewriteRule ^/oldfolder(.*)$ /newfolder/$1 [R]

    This redirects the user from /oldfolder/anyfile.html to /newfolder/anyfile.html, when the .htaccess file is uploaded to the otherwise empty “/oldfolder” directory.

    Denying User Access.

    Add the following to the .htaccess file:

    <Limit GET>
    order allow,deny
    deny from 000.00.00.
    deny from 000.000.000.000
    allow from all
    </Limit>

    This is an example of a .htaccess file that will block access to your site to anyone who is coming from any IP address beginning with 000.00.00 and from the specific IP address 000.000.000.000 . By specifying only part of an IP address, and ending the partial IP address with a period, all sub-addresses coming from the specified IP address block will be blocked. You must use the IP addresses to block access, use of domain names is not supported

    Redirect a Machine Name.

    Add the following to the .htaccess file:

    RewriteEngine On
    Options +FollowSymlinks
    RewriteBase /
    # Rewrite Rule for machine.domain-name.net
    RewriteCond %{HTTP_HOST} machine.domain-name.net $
    RewriteCond %{REQUEST_URI} !machine/
    RewriteRule ^(.*)$ machine/$1

    This will redirect requests for the machine name machine.domain-name.net to the directory machine on the site domain-name.net.

    Different Default Home Page.

    Add the following to the .htaccess file:

    DirectoryIndex filename.html

    Then a request for http://domain-name.net/ would return http://domain-name.net/filename.html if it exists, or would list the directory if it did not exist.

    To automatically run a cgi script, add the following to the .htaccess file:

    DirectoryIndex /cgi-local/index.pl

    This would cause the CGI script /cgi-bin/index.pl to be executed.

    If you place your .htaccess file containing the DirectoryIndex specification in the root directory of your site, it will apply for all sub-directories at your site.

    Preventing Hot Linking.

    Add the following to the .htaccess file:

    # Rewrite Rule for images
    RewriteCond %{HTTP_REFERER} <URL of page accessing your domain>
    RewriteRule ^(.*)$ http://<same as above URL>

    You would replace the <URL of page accessing your domain> above with the domain name and path of the page that is referring to your domain. For example: www.theirdomain.com/users/mypage/

    The RewriteCond directive states that if the {HTTP_REFERER} matches the URL that follows, then use the RewriteRule directive. The RewriteRule directive will redirect any reference back to the referring web page.

    Using the above you should, safely be able to publish your sites on the internet knowing that you will not be privy to bandwidth thieves via hotlinking and also, that you will not lose any traffic through pages that are ‘not found’.

    Article Written By Lee

  • Now They Signed Up – Learn How To Keep Them

    Date: 2011.02.22 | Category: General | Response: 0

    Member retention is going to have a large effect on the adult industry over the next few months, with Visa chargeback rates being lowered and, many affiliate programs lowering their payout model something has to give and, hopefully, the thing that does give will be that affiliate programs start to realize that once they have your surfer, it becomes their responsibility to make that member retain.

    With that in mind this article will look at a few things that we have been doing on some of our paysites for the last few months and, instead of having to provide an excess of plug in content we have started updating our sites regularly within the niche confines of what our members are actually looking for, also, despite this increase in content, we have started doing something unique so far as member retention goes – actually communicating with the member directly.

    Communication Pays.

    Actually spending the time to listen to what your members want can be beneficial on many levels for example, how many of the big sponsors offer the member a chance to become involved in a ‘community’ inside their paysites, i can only think of 3 paysites that i have personally visited that do this.

    Often, offering your members a way to communicate to YOU what they want inside the site can, and usually will increase the value of their membership to you in the long run. offer your members weekly polls, offer them incentives to keep an active membership, perhaps some kind of loyalty program, in addition to a method of your paysite members being able to communicate to each other inside your site.

    Content Updates.

    We all know that paysites need to update however, how many paysite owners spend the time to ask their member what they are looking for? As mention in the previous section, offer your members polls on the next updates you will be doing, ask them what sections of the site need improving and, more importantly, ask them if they are happy with how your site looks and feels overall.

    Renewal Time.

    So you have managed to keep hold of your paysite member for a few days without them canceling and, their trial period is ending what now? Well, more often than not, communicating to the member that they are about to get rebilled can have a positive effect, send them an email prior to the rebill informing them of what your next set of updates will be, let them know they are a valued member of the site and, more importantly than this, that you are there to help them and listen to their suggestions. This is also an ideal time to remind them of why they joined your site in the first place, you have a lot of exclusive content that, simply put, no other paysite can offer them, you listen to their feedback and, again, value their feedback, all of these things will ensure that your member base retains well over the trial period.

    Second Month Renewals.

    So you have managed to keep your member for a month, and, again they are due a rebill, as with the first rebill you gave them, re-iterate the points of your site and, tell them what has changed over the past month, give them some sales speak about how your site is doing and, more importantly, what you have coming next month, by communicating these updates to your members a day or so before they have to renew, you should, in all honesty, keep their interest in your paysite and, more importantly, make more money from your members.

    So Your Member Cancels.

    Okay, so perhaps you managed to rebill your member for a few month or, perhaps they left after the trial period, what now? Simple, send them a follow up email, find out the reasons they cancelled their membership to your site and, see if you can offer them an alternative to stay, perhaps a reduced cost membership or, maybe even an alternative site altogether, if they entered your teen pay site and, were looking for amateur teen pics, even though you know you don’t have them yet, you will probably know of a site that does, tell this cancelled membership about this site and, get them to try it out, if you can match what the surfer is looking for to a site you own then you have a second chance at keeping their membership and, making money.

    Retention Overview.

    When all is said and done the one thing that is apparent so far as pay sites go is that a lot of them do not communicate with their members and build the sites they operate around what their members are looking for, we can all say we actually do this constantly but, how many of us really, hand on heart, can prove that they ask, listen and, more importantly, implement the feedback from their members base?

    Article written by Lee

  • Redirecting To A Different Page Using JavaScrip

    Date: 2011.02.24 | Category: Scripts | Response: 0

    There are times when a simple JavaScript redirection from one page to another can come in handy and, the following JavaScripting will enable you to do this.

    When a page contains this javascript, it will be redirected to another page that you specify in the “window.location=”. You can change the number of refresh seconds by changing the “move()’,1000 to the number of seconds you’d like.

    Example:

    1000 = 1 second
    2000 = 2 seconds
    3000 = 3 seconds

    Place this JavaScript code between the <head> and </head> tags

    <script language=”JavaScript”>
    <!–hide from old browsers
    var time = null
    function move() {
    window.location = ‘http://www.yourdomain.com’
    }
    //–>
    </script>

    Place this JavaScript code in your <body> tag

    <body onload=”timer=setTimeout(‘move()’,1000)”>

    You should now have a page that will redirect to a new url when it loads in the surfers browser window.

    Article written by Lee

  • The Adult Internet – More Than Just Porn

    Date: 2011.02.24 | Category: General | Response: 0

    So you have several adult websites up and running and, if you are one of the lucky few in this day and age you have already started to make money from your adult sponsor programs however, there are so many other ways that webmasters can make money in the adult industry in addition to their regular ‘porn site’ sponsors yet, many webmasters do not realize there are vast opportunities awaiting them.

    Lets spend a few moments to look at the alternative sources of income that we can use in the adult industry and also take a look at the basics of each type of affiliate system.

    Email Collection.

    Opt in email is big business, there is no denying this fact so why not jump on the opt in email collecting bandwagon? Most email collection sponsors will offer you anywhere from $0.50 per email collected to $2.00 per email collected and, better still, to start making money from your existing traffic base all you need to do is include a small email collection box.

    Software Programs.

    Many of the larger adult affiliate programs now offer their webmasters a range of software products to generate additional income, many of these products are good for use not only in adult but, also in mainstream. For instance, Anonymous browsing software, history deletion software, IE Toolbars and even submission programs are all good ways to generate additional income either on a per download or, per sale basis. Best of all, you only need to add a new banner to the sites you currently have in order to get a share of this lucrative market.

    Herbal Products.

    Penis Pills, Breast Enlargement, Vitamin Supplements, you name it you can sell it on adult traffic. Whether you run a TGP, Link List or your own collection of free sites, these herbal products can often sell much better than ‘porn sites’ and, for the most part, the payout levels are the same, if not higher than what your regular ‘porn site’ trial will make you. Again to get started with this type of sales all you need to do is add a text link or banner to your existing sites.

    Casino Sites.

    Gambling makes BIG money, just look at Vegas for the example, millions of people a year visit Nevada to gamble and millions more simply can’t get there for a range of reasons however, almost every home in the United States has a computer and internet connection so why not start using this to your advantage? Many of the larger casino affiliate programs will pay based on the amount of funds credited to a new users account and, to get started making money from casino sites it is quite literally as easy as adding a banner or text link to your existing sites again.

    Pre Paid Services.

    Such as Credit Cards and the likes, selling these types of products to your adult surfers not only offers then ‘anonymity’ on the web when they do make online purchases but at the same time when your surfers sign up or one of these pre-paid credit cards you will be making some money in the process. Often however you will find that these types of affiliate program do not payout as much ‘long term’ as they are pretty much a first time deal as far as, once the surfer spends money to initially ‘charge’ their pre paid card with funds, that is when you will make money and not again. Still, even if you can make $50 by selling one of these cards, its still an additional $50 you wouldn’t have made otherwise.

    Adding To Your Profits.

    As you can see from the above, there are a wide range of products and services you can offer your surfers and, as we all know, the more things we can offer our ‘customers’ the more chance we have at one of them buying something. Of course, as with anything, the more effort we put into marketing these products and services the more chance e have at making a sale however, unless we try to sell the surfer something other than porn, how will we know whether they will buy or not?

    Article written by Lee

  • Why Go Adult?

    Date: 2011.02.21 | Category: Hosting | Response: 0

    When choosing a hosting company why choose an adult host over a mainstream one?

    Simple, They provide above other things, a better quality of service, affordability and, most importantly, reliability.

    Adult hosts face a variety of technical and support issues, this coupled with the points mentioned above makes them a far superior choice to standard mainstream hosting providers. This is one of the main factors why more and more mainstream internet based companies are now turning to the adult business forum to provide their hosting solutions.

    Mainstream going adult? Yes that’s right, more and more mainstream companies are turning to our industries hosting providers for the fast speeds, security and, reliable infrastructures they can offer after all, adult sites are amongst the most prolific on the internet on average gaining more daily hits to their sites than mainstream websites so, they need to be cost efficient, not only to the hosting companies but, also to their clients, the webmaster.

    Our industry strives on the use of heavy graphics, coupled with streaming media files to secure sales and longevity, this is why the adult hosting companies need to be able to provide not just a single, heavily laden server but tens of them, sometimes even hundreds all producing gigabytes of traffic on a daily basis.

    Adult hosting companies are constantly upgrading their equipment in order to improve not just their servers, connectivity but also the smaller things that are often overlooked by webmasters, hubs, routers, switches and the likes along side the not so technical aspects of running a host, The staff.

    Along with all of this technical equipment they also need to maintain a high level of technical knowledge, after all, not just anyone can install operating systems capable of running multi-million dollar industries. They need the knowledge to maintain, upgrade, repair and sell their services to the best of their capabilities.

    What does this mean to you? Well, we all want to make money and, through the use of faster servers, e-commerce solutions and the technical support your hosting provider can give you, you will be fattening your wallet on a daily, weekly, monthly basis.

    Adult hosting, quite simply, is the crème de la crème of the hosting world, they offer solid, solutions whether you are starting in the adult industry or, operate a mainstream e-commerce site.

    So how do you choose a host that is right for you?

    You need to ask some basic questions of the host and, do your homework. Not only should you find out what hosting solutions they can offer you but, you need to find out what their support service is like, how affordable they are in comparison to other companies who can offer similar or the same service. Whilst on the subject of hosting support, before you sign on the dotted line, give your host a call out of office hours, if they answer, then you can almost be certain they are a good hosting provider.

    Of course, not all hosts will have 24 hour phone support, however, that said, some offer 24 hour icq support, email support and more.

    Another sure fire way to find out if a hosting company is any good is to ask on the heavily traveled webmaster message boards, after all, you are not the only webmaster out there who will have tried this company, if they are no good, someone will know about it and point you in the direction of a reputable host like http://www.webair.com.

    Hopefully, this article will have given you some insight into the world of adult hosting companies and, will assist you in making the right choice of host for your site, whatever type of website you might be hosting.

    Article Written By Lee

  • Billing Solutions For International Surfers

    Date: 2011.02.21 | Category: Billing Solutions | Response: 0

    We all know the lifeblood of the webmaster is to be able to accept credit cards for site access however, with the global markets emerging more and more, many webmasters still do not realize that they can accept credit cards from international countries at little or no extra cost to themselves or, their business.

    Presuming you already have your sites translated into a selection of global formats you need to make sure you can process foreign transactions and, these should be handled differently than regular US based credit card users however. This is what we will approach upon in this article.

    The main reason we own our businesses is to turn a profit and, from a profit making point of view is just how the details below will enable you to benefit your long term global business.

    The first step you need to take in order to correctly ‘charge’ your international customers is to ensure that you are sending them to the right language, after all, over 70% of internet users can not speak English, let alone read it. This is where having some geo-scripting comes in handy on your join page, the second the surfer hits this page he (or she) will be directed to a localized version of your join page.

    Now that you have the surfer on your join page you also need to ensure they have a variety of options available to them to actually finalize the purchase however, you should also ensure that, if they want to view your join page in another language, that they have this as an option too.

    Some alternate payment methods for your international customs could include one or more of the following, PayPal, JCB, Mastercard, Discover, Maestro, EuroDebit, Checks and, of course, a dialer.

    I would however use the dialer as a last minute option should their chosen method of payment not be accepted.

    Even though you may run a ‘recurring’ based site, you might not want to have your foreign surfers recur and risk having their card declined when it comes to authorizing your charge next, for this reason you may like to add the option of a 3 month membership or perhaps a 6 month membership however, make sure you lower the cost of this membership in relation to buying a monthly membership, this might just be the clincher you need to close the international sale.

    As with any purchase the after sales support is also needed, especially if you are wanting your international customer to rebill for several months and, trust me, they WILL rebill, often for in excess of 6 months. They pulled their credit or debit card out for a reason and, they will stay if you can give them more reason too.

    With any type of sale a follow up is always good, many sponsors and processors send out an email automatically upon sign up, however, how many of these emails are written in the surfers native tongue?

    In conclusion, when dealing with international customers you should cater to them NOT make them cater to YOU by doing this you will ensure the longevity of your international business.

    Finally, if you have any type of online business you should carefully consider the global market place as it is growing a rapid rate with millions of new international surfers coming online each year this would be a bad business choice on your part if you were not to cater for them.

    Article written by Lee.

  • Building Your Brand – Business Basics

    Date: 2011.02.21 | Category: Branding | Response: 0

    Many online businesses have a good solid brand name attached to them already for example, ARS (http://www.adultrevenueservice.com), Webair (http://www.webair.com) and, WEG (http://www.wegcash.com). These companies have worked long and hard to build up their own brand name on the internet and, specifically, in the adult industry where, it almost seems that everyone is out to make a name for themselves so, how do you as a small business owner get a piece of this branding pie?

    Branding Basics.

    The word ‘Brand’ or ‘Branding’ can refer to several items when used as a noun to describe a company name, product, service or, trademark. Branding started centuries ago when cattle ranch owners used to place their unique insignia on their cattle so that surrounding ranch owners knew who the cattle belonged to and, so that the owners of the brand knew if their cattle were being stolen by others.

    Starting The Branding Process.

    From the very first site you build you should start working on your own inimitable brand name or logo, perhaps it will consist of a small logo on top of every page you build or even a simple text link for your sites domains, either way, the one thing that is important in recognizing a brand is being able to place it to a product instantly.

    Building Your Brand Name.

    Now that you have started the branding process how can you continue to grow your businesses brand name or product even further? This is what we will take a look at next.

    Domain Name Registration.

    Buy the domain name that is representative of your ‘brand name’ if your brand is going to be 123pornosex then go and register 123pornosex.com be cautious though, just because you think of a brand name, you should ensure the domain is available to register BEFORE you start using that brand in detail.

    Getting The Word Out.

    This may seem like the hardest of tasks at first but, once you make a start in branding your site or, yourself this is relatively easy to keep up on an ongoing basis.

    Visit the boards, use your tagline as often as possible and, either mention your brand name in the tagline or, link to your brand names website. This is especially easy to do if you run a TGP or some other site that needs to attract webmaster traffic in order for it to succeed.

    Start your own newsletter, this may seem an odd way to build your brand up but, if you name your newsletter the same as your brand name for example you might have a text link saying:

    Join the BRANDNAME Newsletter.

    This keeps the branding process alive and well. The next step you should take it to ensure that the sender address of the email is something like brandname@brandname.com again, even though you have collected the email addresses by sending out mailings from an address like the one above you have more of a chance of your brand name actually staying in the mind of the newsletter recipient.

    In addition to a newsletter, you might also like to consider having a designer make you a logo or button you can use on your site/s this will come in handy for several uses for example, if you own a traffic site you can use this logo as a reciprocal link, you can use it in your signature on message forums and, you can even include it on sites you build.

    You might also like to consider writing articles for other sites to use, usually the sites that publish your articles will place a link or a small bio to you or your site, this is another way to increase the ‘exposure’ of your brand.

    Branding Overview.

    All in all, building a brand name for yourself or your business need not be a hard and tedious task in fact, if you start off almost immediately building up name recognition for you and your sites. Regardless of what type of product, service or site you operate getting your brand name recognized by both webmasters and surfers can lead to a lot of money long term, start now and reap the benefits later in your career.

    Article written by Lee.

  • Doorway Pages

    Date: 2011.02.22 | Category: Traffic, WebDesign | Response: 0

    A doorway page is built to rank high for a particular keyword or search phrase. When your doorway page is visited by the searcher it simply has a “click me” button which links to your web site. The major search engines accept these pages as long as the end result does provide what the searcher is looking for. If you are discovered to be using doorway pages for irrelevant keywords you can expect to have your entire domain unlisted. For instance, one of our doorway pages is built to rank high for the search term -Adult Content—which is quite acceptable because when the searcher gets here he can find links to adult content providers from our site. If however, he couldn’t find links to adult content then we would risk the wrath of the all powerful search engines.

    Once you have selected your keywords and phrases (about 50 would be the normal) you need to build a doorway page for each keyword and ideally, for each major search engine. All the major engines look for different keyword density in the text, title and description so you need to do some research by doing a search using your chosen phrase or keyword and studying the top 10 results at each engine (if you can spot them, study high ranking doorway pages).

    Make notes of how many times the phrase or keyword is used in the title, description and body text. Is it used in header text etc? Once you have built a picture of what your doorway page should look like you can build it using your favorite html editor. Once you have done one for a particular engine the other 50 or so pages can be done by simply replacing keywords for keywords. After you have done a page for each keyword move on to the next search engine. Remember that your body text is not important but make each page unique or it may be considered spamming. It is your keyword or phrase density that you are attempting to get right. The page, when visited by a person, will be recognized for what it is, simply a link to the real content so don’t worry too much about what it looks like. When a search engine spider visits the page it is only interested in counting the keyword density in your body text.

    As you have probably worked out there is quite a lot of work involved. 50 phrases or keywords=50 pages X the top 8 search engines= 400 pages. In reality though, you are only creating 8 doorways, 1 page for each search engine. For all the other pages you simply have to substitute the keyword for the next and alter the text around so as not to finish with 50 identical pages. OK, nearly finished but the next step is crucial if your doorways are to work.

    Put all your pages in a folder on your server e.g. Mydomain/doorways/. Then create 2 more pages that have a link and a small description to each of your doorways (200 on each) and to each other. These are called corridor pages because the spider travels down them, visiting each page linked off them. Call these 2 pages index and home and place them in the folder with your doorway pages. Then place links to these two pages from your main index page so that a spider will be able to find them and list all your doorways. Submit only your index page and your 2 corridor pages. Do not submit your doorways to the engines.

    Ideally, and if you can afford it, you should set up a new domain and host for your doorways. This isn’t essential but it does have benefits. These are: If you do get over zealous with your doorways and an engine does ban you for spamdexing at least your real site will be safe. Engines rank sites higher if they have lots of links to them from other domains. You can put your most important keywords in your new domain name, which will increase the ranking of the doorway pages containing those keywords.

    Now all you have to do is wait for the engines to update their databases. We have had the best results with Google.

    Article written by Lee

  • Message Boards – Getting The Postings

    Date: 2011.02.23 | Category: General | Response: 0

    There are plenty of free scripts available on the web which will enable you to start your own online discussion forum.

    However, having the most sophisticated and advanced features in a forum does not mean it will be successful by any means. It is the people who post on the forums that make them good not the scripts used to maintain them. This article is dedicated to getting people posting on your forums.

    It can be really quiet on your forum especially at the beginning when there are no real discussions going on, this is because people don’t want to be the first to post. They want to see some topics that interest them already being discussed, they want to be able to read through some posts first before having to post themselves. With this in mind, you should also be aware that just because a forum doesn’t seem busy, it can in fact get thousands of hits a day. Lurkers make message boards what they are, and, for this reason alone you should act professionally and courteously when making posts on any forums, one day, you might have to do business with one of these so-called ‘lurkers’ and, if they have seen you in a bad light on a forum, the chances are they wont want to know you. So what do you do to get your message board off the ground? There are a number of things actually and, some of these are as follows.

    First of all, make sure the signup process is as simplistic as possible, even better, ensure if the user doesn’t want to register, they don’t have to! To attract people to post on your boards why not get a few of your friends together and start some discussions of your own, you could even register a couple of different usernames so that your forums look busier than they actually are thus cementing the thought that your forums are active and will have worthwhile discussions taking place.

    To find some current topics for your forums why not visit some of the other message boards and see what people are discussing, if a topic is receiving a lot of interest, post about it on your forums. This is especially a good idea if your forums are specific to one area after all, if your competitions forums posters are interested in this topic, your forums users will be too.

    Another great way to get people to start talking on your discussion forums is to use a contest. For example, currently on European Webmasters we have a content giveaway whereby for each post you make you gain a point and, once you have reached a certain level of points you will be able to download exclusive content sets. If you are going to start a competition then make sure people are aware of it, post some information about it online and get something to giveaway that everyone wants.

    One other method to get additional posts is to put up subject lines and links to the topic threads from your main website page. Again, if you publish articles on your site create a link to your discussion forums and invite people to openly discuss the articles in question, not only will you get people posting on your message board but, you will also gain invaluable information from your user as to what they look for and want in articles you write.

    If you publish a newsletter, again, this is another great way to build interest in your message board. Simply ask them to post, tell them you are building up a great resource and, you need their help as much as you need theirs to make this happen. If you have provided them with high quality information in your newsletter the chances are they will repay you by posting on your message board.

    In conclusion, you should basically try and plug your message board wherever you can by doing the above, create banners for it and display them on your website, place a note in your signature file encouraging people to visit and post if they require assistance with anything. Its hard work but, once you have a few regular posters it will take off.

    Article Written By Lee

  • Cascading Style Sheet Basics

    Date: 2011.02.21 | Category: WebDesign | Response: 0

    CSS (Cascading Style Sheets) have been around for a while now, and act as a complement to plain old HTML files.

    Style sheets allow a developer to separate HTML code from formatting rules and styles. It seems like many HTML beginners’ under-estimate the power and flexibility of the style sheet. In this article, I’m going to describe what cascading style sheets are, their benefits, and two ways to implement them.

    Cascading What’s?

    They’re what chalk is to cheese, what ice-cream is to Jell-O they complement HTML and allow us to define the style (look and feel) for our entire site in just one file!

    They get their name from the fact that each different style declaration can be “cascaded” under the one above it, forming a parent-child relationship between the styles.

    They were quickly standardized, and both Internet Explorer and Netscape built their latest browser releases to match the CSS standard (or, to match it as closely as they could).

    So, you’re still wondering what a style sheet is? A style sheet is a free-flowing document that can either be referenced by, or included into a HTML document (Kind of like using SSI to call a file but not, if that makes sense). Style sheets use blocks of formatted code to define styles for existing HTML elements, or new styles, called ‘classes’.

    Style sheets can be used to change the height of some text, to change the background color of a page, to set the default border color of a table the list goes on and on. Put simply though, style sheets are used to set the formatting, color scheme and style of an HTML page.

    Style sheets should really be used instead of the standard , < b >, < i > and < u > tags because:

    One style sheet can be referenced from many pages, meaning that each file is kept to a minimum size and only requires only extra line to load the external style sheet file

    If you ever need to change any part of your sites look/feel, it can be done quickly and only needs to be done in one place: the style sheet and furthermore, it is done globally.

    With cascading style sheets, there are many page attributes that simply cannot be set without them: individual tags can have different background colors, borders, indents, shadows, etc.

    Style sheets can either be inline (included as part of a HTML document), or, referenced externally (Contained in a separate file and referenced from the HTML document). Inline style sheets are contained wholly within a HTML document and will only change the look and layout of that HTML file.

    Open your favorite text editor and enter the following code. Save the file as styles.html and open it in your browser:

    Cascading Style Sheet Example.

    h1
    {
    color: #636594;
    font-family: Verdana;
    size: 18pt;
    }

    This is one big H1 tag!

    When you fire up your browser, you should see the text “This is one big H1 tag!” in a large, blue Verdana font face.

    Let’s step through the style code step by step. Firstly, we have a pretty standard HTML header. The page starts with the tag followed by the tag. Next, we use a standard tag to set the title of the page we are working with.

    Notice, though, that before the tag is closed, we have our tag, its contents, and then the closing tag.

    h1
    {
    color: #636594;
    font-family: Verdana;
    size: 18pt;
    }

    When you add the style sheet code inline (as part of the HTML document), it must be bound by and tags respectively. Our example is working with the tag. We are changing three attributes of the ’s style: the text color (color), the font that any tags on the page will be displayed in (font-family), and lastly, the size of the font (size).

    The code between the { and } are known as the attributes. Our sample code has three. Try changing the hexadecimal value of the color attribute to #A00808 and then save and refresh the page. You should see the same text, just colored red instead of blue.

    An Example Of An External Style Sheet.

    External style sheets are similar to internal style sheets, however, they are stripped of the and tags, and need to be referenced from another HTML file to be used.

    Create a new file called “whatever.css” and enter the following code into it:

    h1
    {
    color: #a00808;
    font-family: Verdana;
    size: 18pt
    }

    Next, create a HTML file and name it test.html. Enter the following code into test.html:

    External Style Sheet Reference Example.

    This is one big H1 tag!

    As mentioned above, you can see that the actual code in whatever.css is exactly the same as it was in the inline example. In our HTML file, we simply place a tag in the section of our page. The rel=”stylesheet” attribute tells the browser that the link to the external file is a style sheet. The type=”text/css” attribute tells the browser that whatever.css is a text file containing CSS (cascading style sheet) declarations. Lastly, the href=”whatever.css” attribute tells the browser that the actual file we want to load is whatever.css.

    Conclusion.

    Well, there you have it, a quick look at style sheets and how to implement both an inline and external version. Checkout the links below if you’ve never worked with cascading style sheets before. You will be surprised at some of the things you can do with them!

    Article written by Lee.

Premium Sponsors















Categories

Site Links