-
What On Earth Is CGI?
Let’s unlock a little bit of the mystery about something called CGI. If it helps any, CGI means Common Gateway Interface.
This is a method which is used to swap data between the server (the hardware and software that actually allows you to get to your web site) and a web client (your browser). CGI is actually a set of standards where a program or script (a series of commands) can send data back to the web server where it can be processed.
Typically, you use standard HTML tags to get data from a person, then pass that data to a CGI routine. The CGI routine then performs some action with the data.
Some of the more common uses of CGI include:
Guest books – The CGI routine is responsible for accepting the data, ensuring it is valid, sending an email acknowledgement back to the writer, perhaps sending an email to the webmaster, and creating the guest book entry itself.
Email Forms – A simple CGI forms routine just formats the data into an email and sends it back to the webmaster. More complicated routines can maintain a database, send an acknowledgement and validate data.
Mailing List Maintenance – These routines allow visitors to subscribe and unsubscribe from a mailing list. In this case, the CGI routine maintains a database of email addresses, and the better ones send acknowledgements back to the visitor and webmaster.
A CGI routine can be anything which understands the CGI standard. A popular CGI language is called PERL, which is simple to understand and use (well, compared to other languages). PERL is a scripting language, which means each time a PERL routine is executed the web server must examine the PERL commands to determine what to do. In contrast, a compiled language such as C++ or Visual Basic can be directly executed, which is faster and more efficient.
Okay, in a nutshell (and greatly simplified), here’s how it works:
1) You (the webmaster) specify a form tag which includes the name of the CGI routine.
2) You create HTML tags which retrieves data from your visitors.
3) Each of the input tags includes a variable name. The data which is retrieved from the visitor (or directly set if the tag includes the “hidden” qualifier) is placed in the variable name.
4) When the visitor presses the “submit” button, the CGI routine which was specified in the form tag is executed. At this time, the CGI routine “takes control”, meaning the browser essentially is waiting for it to complete.
5) This CGI routine can get data from variable names. It retrieves the data and does whatever action is required.
6) When the CGI routine finishes, it returns control back to the browser.
Some important things to remember about CGI routines:
You can install CGI routines on your own site if your host allows it http://www.webair.com is an example of a web host which allows for CGI routines. Some web hosts do not allow you to install your own routines but do provide some pre-written ones to you. If these are not sufficient for your needs, you can find a remote hosting service to provide the necessary functions.
Generally, if you install your own routines they must be installed in the cgi-bin directory of your site. This is a special location which allows scripts and programs to be executed.
CGI routines work best on Apache-style servers. Windows NT and Windows 2000 does support CGI, but it tends to be slow and problematic.
If you use a remote hosting service, you must remember that although they appear to be giving you this for free, you are actually paying a price. Usually they want to display advertisements, although some of them actually take visitors away from your site.
When you write a CGI routine, you have the choice of a scripting language like PERL or a compiled language such as C++ or Visual Basic. Anything which can execute on the web server is acceptable.
I hope this short introduction to CGI has cleared up some of the mystery.
Article written by Lee
-
Seasons Greetings For The Adult Surfer
How do the national and, international holidays affect our sponsors sales? More than you would think especially if you can offer your surfers something ‘seasonal’ when they hit your site. However, that said, when should you start planning for these holidays and, more importantly, how can you ensure that once you have implemented your seasonal marketing campaigns that they actually work?
Seasonal Marketing – The Basics.
Seasonal marketing is, in effect a method of changing your marketing approach around different times of the year to affect both the volume of sales you make and, more importantly, the uniqueness of the product you are offering your surfers. A good example of this is at Christmas time, many of the sponsors will provide their webmasters with banner with a holiday feel to them, perhaps using scantily clad men in Santa outfits or half naked women in elves costumes. By offering a seasonal marketing approach to your site surfers you actually increase the chances of making a sale.Holiday Porn.
One of the best ways to offer your surfers a fresh marketing angle is to ensure that you plan for all of the major holidays throughout the year in advance so for example, as mentioned above, Christmas is a big holiday as are, New Years, Easter, Thanksgiving (US), Independence Day (US) and, Halloween. By building sites specifically for these holidays you are increasing the chances not only of building your sales but, of gaining additional traffic that you might otherwise lose out on. It has been said certainly over the last four years i have worked in the adult industry that many webmasters experience an increase in search engine traffic searching on keywords such as ‘Christmas Porn’ and, ‘Ghost Porn’ around the various holidays, build now for next year and, when the holiday season arrives, you will be one step ahead of your competition.Seasonal Marketing Overview.
As already mentioned the holiday season especially Christmas time, can be a great way to gain additional traffic, not only from those surfers specifically looking for Christmas Porn but, also the newbie adult surfers who have perhaps only just got their first computer on Christmas day, by adding to your collection of seasonal porn sites year after year you will not only learn a lot about the way the various holidays and seasons affect your sales but, you will also be able to profit from your surfers in a way that not many other webmasters do.Article written by Lee
-
Quick Loading Pages Plus Saving Bandwidth
Have you noticed how many of the sites out there are trying to make themselves look better than they actually are by using heavy graphics and media files? The fact of the matter is this, most surfers who visit your we pages are viewing them on a screen that is between 15 and 19 inches wide, can only see 216 colors and, are on a connection of 33.6 kb per second (If they are lucky).
What Does All This Mean?
What does this mean to you as a webmaster? Simple, try this test.Connect to the internet on a 33.6 connection, type in your url and, hold your breath. Does the page load before you need to start gasping for air? If so then you are designing your sites correctly, if not, your pages are far to big in file size.
I’m pretty sure that some of you can hold your breath for a long period of time so, here is a basic rule of web design. Your pages should, be no larger in file size than 50k in fact, I would even go so far as to say try getting your pages under 30k in size.
How Can I Get It Under 50K? 30K?
First, all your graphic images should be as small as possible. Try to get them smaller than 4k. Going up to 6k is reasonable. When designing a graphic for the web site keep in mind the number of colors being used.I know, from designing banners myself, it was hard for me to go from millions of color to only 216. Yes, 216 is the number of colors you have on a web safe color pallet.
Use solid colors when designing your image. PhotoShop has made the gradient such a popular tool. It looks good to fade things in and out. I always see a background border made up of this gradient. I always right click on that image to see the size. The 8k-12k is not worth the space. The problem with the gradient is it uses many colors and dithering. Both take up big time K. The more color you have in an image the bigger it’s going to be.
Use design more, graphics less. For a web page to be successful it needs to download quickly and look good.
Here is the dilemma download quick or look good? Instead of designing graphics and taking pictures and turning them into jpgs to make your web page look good, try using color schemes. Use cell colors to make borders. Use the negative space on your web site. What is not there is just as important as what is there.
Remember sometimes less is more. When in doubt think of a typical visitor coming to your web page. Would that extra graphic sell them or keep them coming back again and again. If the answer is yes, by all means keep it. If the answer is “well maybe” or “it just looks good there”, yank it.
Your surfers will appreciate not waiting more then they have to. The web is here to make our life easier not to sit in front of a screen waiting for heavy web pages to download.
Article written by Lee
-
The Next Big Traffic Craze – Thumbnail Link Lists
As adult webmasters are constantly thriving to create the next craze in traffic sources to garner sales from their sites it comes as no surprise that there is already talk amongst the ranks of the next big thing, what is this new idea? The Thumbnail Link List.
Thumbnail Link Lists – Re-Inventing The Wheel.
As the past year and a half have taught us as webmasters, regular TGP’s have almost become a thing of the past with more and more thumbnail TGP’s being created and submitted to daily, why then, has it taken so long for someone to think up the idea of the Thumbnail Link List? Quite simply I think it has been a case of to much has happened over the last 12 months in the adult industry for webmasters to think this idea up.So What Is A Thumbnail Link List?
A thumbnail link list is in effect a way of displaying free sites on your own standard Link List by utilizing small thumbnail samples of the images contained within the free sites galleries, in fact, much the same way that a thumbnail TGP works however, instead of only listing single image galleries your link list will consist of links to individual free sites.Much like the Thumbnail TGP traffic source, the thinking behind the Thumbnail Link List is that by showing your surfers what type of pictures the sites within your link list contain they will be more likely to visit the free site thus improving your CTR to your webmaster submitted sites and, ultimately, your site overall allowing you to manipulate the traffic to garner more sales for yourself as the Thumbnail Link List owner.
Submitting Your Site To A Thumbnail Link List.
Looking at the Thumbnail Link List idea from a webmaster who would be submitting your free sites for listing (and ultimately traffic) how do the rules of the Thumbnail Link List differ to that of the regular link list which we are all used to seeing, well for a start, the main difference will be that you either need to submit a thumbnail yourself or, enter the url to one of your gallery pages in addition to the main entrance to your free site, this will actually be the only significant change in how you operate your link list submissions compared tot he current link list method, however, as each Thumbnail Link List owner will have their own individual rules you should check before submitting as to what is required from you as a submitter.Thumbnail Link Lists – Overview.
The whole Thumbnail Link List idea is one that, in all seriousness should mean more traffic not only for the submitters of the free sites but, also for the Thumbnail Link List owner themselves, by offering the surfers a preview of the content contained within the free sites they will be visiting they can simply reduce the amount of sites that do not appeal to them and focus more on the sites that do meaning that the webmasters who submit highly niched free sites to the links lists will now be able to benefit from a larger traffic base and ultimately, more sales.Article written by Lee
-
Adult Employment Vacancies
For some the prospect of being able to work for another company online is something that they may ultimately want to pursue however, just how do you go about finding work for one of the many adult companies and, more importantly, how can you ensure that you have a better chance of being hired for the job once you find the position you would like to have at the company?
Online Adult Employment – Job Types.
Working in the adult industry can take many forms however, the most commonly perceived adult industry job is that of a model but, what about other online job vacancies such as graphics designer, marketing manager, sales director, and webmaster support representative, just how do you find out what companies are hiring and more importantly, what adult employment vacancies they have.Adult Employment Agencies.
For many webmasters the chances of finding employment in the adult industry at a ‘regular’ online employment agency such as monster.com may seem impossible however, that said, many of the larger companies have realized the value of the mainstream employment agencies and, as such are now advertising on these sites for their staff but where else can you look? Well there are actually several adult industry employment sites that adult webmasters can look at to find their ideal job for example Adult Staffing, Sexy Jobs and, Adult Help Wanted in addition to several smaller sites operated by companies such as Cybererotica.Improving Your Employment Chances.
So now you know where to look for adult employment opportunities what can you do to ensure you have a greater chance of being hired? Well as with the mainstream bricks and mortar job market having a good curriculum vitae (CV) can be a good start, ensure you keep your CV regularly updated and that it contains pertinent information for the type of job vacancy you are looking for in addition, often the first method of contact you will make with these potential employers will be via email or cover letter, make sure that you spend some time to write a letter that is not only noticeable but, interesting and, more importantly, grammatically correct. Demonstrate in this first stage of contact with your potential future adult employer that you take pride in your work and, you might just get bumped to the top of the ‘must see’ applicants.Adult Jobs – Overview.
Many webmasters forget that there is more to the online adult industry than being able to party with the best of us and, whilst this does form a chunk of the industry overall it is not conducive of you further enhancing your online career, take the time to investigate all of the avenues available to you and, most importantly, make sure you choose a job that you not only want to do but one that you will enjoy, your reputation is the one thing that a potential adult employer will take into consideration, if you have had several previous jobs all lasting for short periods of time, it wont look as good to them as if you have only had a couple of jobs for a lengthier time frame. Most of all remember that whenever you contact a company looking for employers, make sure you are prepared and professional even if it is just sending them a quick email asking for further information.Article written by Lee.
-
Converting Chinese Adult Traffic – The Niche Paysites That Work
Converting Chinese Adult Traffic – The Niche Paysites That Work.
To date we have looked at most of the types of country specific traffic available to webmasters every day and, more importantly, which niches they convert on. In this article we will finish up our look at the foreign traffic and how profitable it can be with the final main country on the net – China.Chinese Adult Surfers – Quick Analysis.
As with Japanese traffic, most webmasters seem to think that Chinese speaking adult surfers are pretty worthless when it comes to buying porn memberships and this is true – If you do not know what niches to offer your Chinese surfers that said, we found some interesting results given the three (3) month test we had on our Chinese traffic and, the results we observed might just make you change your mind about sending the Chinese surfers you get to your sites off to traffic trades.Chinese Porn Surfers – The Niches.
Because we knew relatively little about the Chinese traffic we had on our sites we decided that, rather send it to a specific language hub site we would send it to our main hub page and, allow the Chinese surfers to filter themselves through to the sites that interested them on their own, to our surprise, only 40% of the traffic we knew was Chinese chose to filter itself to a Chinese specific language hub site, the remainder, choosing to go through our main English hub site.Fetish.
Across all of the niches we offered the surfers, the Fetish niche was the one that converted most consistently month after month and, more than converted, actually retained members once they had signed up to the paysites.Gay.
Unlike the traffic we had that was Japanese a lot of the Chinese traffic that hit our site decided to visit the Gay niche paysites we had to offer them and, there was less than 10% difference between the Fetish and Gay signups we observed month after month. Quite a difference when compared to surfers from Japan and, a pleasant one at that.Amateur.
Specifically teen amateur niche sites or, at least sites that had amateur looking teen modes on the tours also did well on our Chinese traffic however, the conversion ratios for the recurring programs didn’t do as well as what we had expected with most memberships being cancelled within 2 months. Non the less, the Chinese surfers did join and most of them re-billed in excess of 1 month before leaving the site.Teen.
As mentioned above, it would appear that Chinese porn surfers are looking for teen niches again though, the teen paysites we used featured amateur looking teens prominently on the pages so whether this was a choice on the surfers part to join the teen sites or, because we only offered amateur looking teen paysites isn’t known.Asian.
Unlike Japanese surfers, Chinese surfers also joined the Asian niches that were offered up to them and, surprisingly enough, we noticed more signups to English Asian sites than localized Chinese pay sites.Chinese Adult Surfers – The Results.
Overall we were very impressed with how the Chinese traffic we had flowing through our sites both acted and, converted on the sites that we offered them to join, especially since the Japanese traffic we had didn’t seem to like the gay niche sites yet Chinese traffic worked wonderfully on exactly the same gay niche pay sites.Across the board I think a revisit of Chinese traffic is needed with more options on our part when it comes to the teen and amateur niches especially just to see if the results we experienced thus far were unique or, are truly indicative of how the Chinese surfer navigates and joins pay sites.
Article written by Lee
-
What Happens Your Current Processor Bails?
Whilst this is perhaps one of the hardest challenges that a webmaster of a paysite can face in the industry it isn’t as bad as they may seem at first after all, there are literally hundreds of processors to choose from ranging from credit card processors, dialer option, micro-sms billing and a wide range of other systems.
The first and foremost thing you should do however when confronted with this challenge is to try and contact your existing processor and find out what will happen to funds that you are owed, will you be paid (in most cases you will).
The next thing you should do is to evaluate your business billing methods are you offering multiple processors already? If so, simply switch to your backup processor and find a new processor to use as a backup.
However, what happens if you only have a single processor on your site what can you do then?
First things first, you need to make sure you choose a reliable payment processor to start off with companies such as iBill, CCBill, CCBill EU, Netbilling and Jettis are all good processors used by a multitude of sponsors and content providers amongst the other companies.
You will most likely find that these companies are more than happy to work with you in the integration of their system onto your site.
Whilst you are awaiting your setup of your new processor to ensure you do not lose any sales it may be an idea to divert your join page off to a dialer or, perhaps have some form of ‘internal’ billing mechanism set up so that, when you do change over processors you can seamlessly transition your member base across.
Now, presuming that you already have an existing member base what do you do then? How easy or hard is it going to be to transfer them across to your new processor? Well based on the situation some were confronted with when Visa introduced the new fees to process adult payments this can vary from webmaster to webmaster again, as before, the easiest solution for you would be to contact the company you will be using as your primary processor and see what they can suggest.
Hopefully, you will have access to a database of your existing members email addresses this will also come in handy to ensure you can keep recurring those members. Send out an email stating that you will be changing your processor and, ask that, if they would like to remain a member of your site that they update their billing information, it might also be prudent to offer them some sort of recompense for having them change processors perhaps something along the lines of 2 weeks low cost or even free access tot he site, this is sure to mean that most of, if not all of your existing members will input their billing information again enabling you to rebill them until they cancel their membership at our new processor.
Of course nothing is infallible so the best advice i can offer you is to work closely with your new found processor and make sure that the transition period happens as quickly and, as smoothly as possible.
Hopefully this article will be of some use to those who do get affected by their processors going out of business and, will also serve as a warning to have multiple processors in place for those who have not or will not have the need to change your billing company.
Article written by Lee
-
Using .htaccess Effectively
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 supportedUsing 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.htmlRedirect 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/$1This 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
-
How To Become A Gay Porn Star
A quick look across the gay side of the adult industry will show it is lacking in one thing that its straight counterpart has in an abundance, amateur male models with their own adult porn sites. With that said, if you wanted to tap into this market how could you go about doing so and, more importantly, could you make money from working on the other side of the camera for a change? This is what we will look at in this article.
Becoming A Porn Star – The Basics.
Any web cam model will tell you, to have your own porn site will take a lot of persistence, time and, more importantly, personality, not least from the webmaster side of the industry however, in my opinion I think the pressure that a webmaster may face breaking into the gay male porn side of the adult industry might just be a bit harsher than what the bubbly web cam girls have to contend with, not only because as a male you will be appearing in content but, because your primary traffic base, whether you like it or not, will be a mixture of women and gay males.Male Amateur Sites – Getting Ready.
Before you start to even put your first ideas down on paper you need to do one thing, spend some time to research what is needed in order to start your own amateur porn site. In doing so, you will see that not only is everything in the two paragraphs above true but, you will also learn a little about yourself and, more importantly, about other webmasters and your surfers. Now you have the fundamental questions you need to ask yourself these are, What equipment do you need to run a male amateur site? What amount of investment in both time and money do you need to put into building your site? How much will you charge your surfers for access to your site? and, Is this going to be a long term commitment from yourself that could be possibly better spent elsewhere? Answer those questions as honestly as you can before proceeding and furthermore, think long and hard about the answers.Gay Amateur Web Sites – The Alternatives.
So lets stop for a moment and consider that you have realized you do not want to build and maintain your own male amateur site but, you would still like to be male porn material, where do you go from here? Well there are companies who can put you on their books and give you work from time to time such as http://www.redbagproductions.com a male modeling agency for the adult industry, this will in all likelihood be the place for you to start your search, find out how many places there are that can get you talent work and, what type of modeling work you will be required to do.Becoming A Gay Porn Star – An Overview.
With sites online such as Every Stag and the slew of other male modeling agencies finding a medium to start your modeling career wont be hard but, with this career comes uncertain hours, hard work (in more ways than one) and, to some extent, fame amongst the gay adult porn surfer. If this is something that you feel you can devote the time and energy towards and, are able to cope with the voyeuristic side of your personality then go for it, if however, you are still unsure after reading this brief article, perhaps becoming a gay pornstar isn’t for you?Article written by Lee
-
Cascading Style Sheet Basics
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
- 2257
- Billing Solutions
- Blogging
- Branding
- Content
- Domain Names
- Employment
- Forms & Contracts
- General
- Hosting
- Link Lists
- Opt-in Mail
- Paid Traffic
- Pic Posts
- Promotion
- Scripts
- Search Engine Optimization
- Sponsors
- TGP
- Traffic
- Tutorials
- Viral Marketing
- WebDesign
- Writing