May 1st, 2007

Poor man’s 3d button with pure CSS

We previously covered how to make a button with just CSS.  In this short howto we will show you how to create a 3d button with just CSS, in what we are calling our “poor man’s 3d button”.

First start off with defining the CSS itself.  Place this somewhere inside your <head> </head> tags or in your CSS stylesheet.

<style type=”text/css”>
a.button,
a.button:visited {
  color:#ffffff;
  display:block;
  border:1px solid;
/* normal border color of button */
/* top color - right color - bottom color - left color*/
  border-color:#4F657D #000000 #000000 #4F657D;
  text-decoration:none;
  width:8em;
  text-align:center;
  height:2em;
  line-height:2em;
  background:#1d83a6;
  font-weight:bold}
a.button:hover {
  color:#ff0000;
  background:#236277;
  position:relative; top:1px;
  left:1px;
/* mouse over border color*/
/* top color - right color - bottom color - left color*/
  border-color:#000000 #000000 #000000 #000000}
</style>

 We’ve put some comments in so you can easily identify where to modify colors for the button.  Also note we have called it simply “button”  and so you can reference it by using class=”button”.

Now in your make a link with class=”button” like below: 

<a href=”http://www.bluechiphosting.com/” mce_href=”http://www.bluechiphosting.com/” title=”my 3d button” class=”button”>3d button yay!</a>

You will end up with a button like this:


3d button yay!
And thats it! We hope you enjoy our poor man’s 3d button!Have fun and happy serving :)

Powered by Gregarious (42)
Share This now!


Related Posts:
  • Make a button without an image editor using CSS!
  • Poor man’s banner / ad rotator

    April 30th, 2007

    HOWTO make portable script shebang with /usr/bin/env

    Not all Unix/Linux systems are created equal.  While on one server you might find your perl binary in /usr/bin/perl another server might have it in /usr/local/bin/perl.

     It is not a huge deal to change this around manually, but there is an option you can use that will give you working script that will work anywhere… Using the /usr/bin/env command.

    Lets say you have a cgi script that does

    #!/usr/bin/perl

    modify that to

    #!/usr/bin/env perl

    And that’s it!  Your script should work on any system that has perl installed.  This can be used for bash, php, etc anything really.  Just replace perl with what you want to use, ie: /usr/bin/env bash , /usr/bin/env php.  Upload your file and it is ready to run anywhere.

    Hope it helps, happy serving :)

    Powered by Gregarious (42)
    Share This now!


    Related Posts:
  • Poor man’s 3d button with pure CSS

    April 24th, 2007

    Make a button without an image editor using CSS!

    You, like most other people will likely want to have a button or thirty.. on your website! Sometimes making one from scratch is kind of annoying in programs like photoshop etc… when all you want is a button!

    We’ll quickly show you the basic of making a button in purely CSS (cascading style sheets) and html.

    Example:
    CSSBUTTON

    To get the results above you first make addition to your CSS file.. or add it to your <head> fields in your html file.

    /* CSS BUTTON */
    .cssbutton {
    /* border color */
    background: #00FF00;
    padding: 1px;
    font-family: Geneva, Vera, Arial, Helvetica, sans-serif;
    font-size: x-small;
    font-variant : small-caps;
    border : 1px solid #AA4422;
    }
    .buttonleft {
    /* text color left*/
    color: #f8f8f8;
    /* background color left */
    background: #AA4422;
    padding: 0px 3px 0px 3px;
    }
    .buttonright {
    /* Right side text color*/
    color: #000000;
    /* Right side background color*/
    background: #1D83A6;
    padding: 0px 20px 0px 3px;
    }

    Then you use the following code in your HTML

    <span class=”cssbutton”><span class=”buttonleft”>CSS</span><span class=”buttonright”>BUTTON</span></span>

    And that’s it… a very simple easy cool looking button. Please note we don’t really want the colors to be this way, we’ve simply placed the buttons in this color so you can see the which elements to change! We’ve added comments to help you identify what colors control what part.

    You can change the padding options to play around with different sizes, do what you want with it. Try it out its a nice and slick way to get a colorful addition to your website.

    Example:
    CSSBUTTON

    Hope it helps! Happy serving :)

    Powered by Gregarious (42)
    Share This now!


    Related Posts:
  • Poor man’s 3d button with pure CSS
  • How to disable ugly HTML image borders in links
  • Poor man’s banner / ad rotator

    April 20th, 2007

    Clean up your computer with cleanup!

     This software is quite impressive honestly.  It is free, it does the job very fast and just works.  Thats good software in my book.  It’s purpose is to free up disk space that is being used by temporary files and all kinds of other evil things,  but all in all it makes your computer run more effitiently. 

     The software is Cleanup! available at:

    http://www.stevengould.org/software/cleanup/

     Every computer we have tried it on, has cleaned up 1-2 GIGABYTES of data.  It’s quite impressive, and has not failed.

    Screenshot below:

    Cleanup! Just works

    It’s an easy to use program that works.  No Gimmicks.  It is rare to run into a good free program nowadays without getting all kinds of advertisement… sometimes even spyware/malware.  This one is a keeper!

    Hope you enjoy it! :)

    Powered by Gregarious (42)
    Share This now!


    Related Posts:
  • No related posts

    April 19th, 2007

    Poor man’s banner / ad rotator

    So you want to add advertisement on your site, but do not want to show the same old advertisement banner all the time?  Well heres an easy and simple solution in PHP that even a someone who copies and pastes the code from a blog site can do… hey.. wait!

    Say you have one image banner somewhere on your site. 

    Cool banner:

    <a href=”http://www.bluechiphosting.com” mce_href=”http://www.bluechiphosting.com”>
    <img src=”banner.jpg” border=”0″ alt=”my cool banner”>
    </a>

    other cool banner:

    <a href=”http://www.bluechiphosting.com” mce_href=”http://www.bluechiphosting.com”>
    <img src=”otherbanner.jpg” border=”0″ alt=”my other cool banner”>
    </a>

    Place the 2 banner codes from above as shown below in your PHP site:

    <?php
    $rand = rand(0, 1);
            if ($rand == 0) {
            echo ‘<a href=http://www.bluechiphosting.com><img src=banner.jpg border=0 alt=my cool banner></a>’;
            } else if ($rand == 1) {
            echo ‘<a href=http://www.bluechiphosting.com><img src=otherbanner.jpg border=0 alt=my other cool banner></a>’;
            }
    ?> 

    And that’s it!   

    You could grow this into potentially big script that has many images, you could also just make text links.. or an entire block of html code.

    This is basicly using the rand() funtion in PHP to pick a random number between 0 and 1, if 0 the 1st image is shown, if its 1 the 2nd image is shown.

    larger sample:

    <?php
    $rand = rand(0, 6);
            if ($rand == 0) {
            echo ‘ONE’;
            } else if ($rand == 1) {
            echo ‘TWO’;
            } else if ($rand == 2) {
            echo ‘THREE’;
            } else if ($rand == 3) {
            echo ‘FOUR’;
            } else if ($rand == 4) {
            echo ‘FIVE’;
            } else if ($rand == 5) {
            echo ‘SIX’;
            } else if ($rand == 6) {
            echo ‘and SO ON’;
        }
    ?>

    That example shows using rand() chooing a number from 0 to 6, hope it helps to understand it. 

    Hope you enjoy our poor man’s banner/ad rotation script!  We never said it was pretty! we said it was easy!

    Author’s notes:  Watch the single quotes! Might want to make sure they are still quotes if you copy and paste! Have fun!

    Powered by Gregarious (42)
    Share This now!


    Related Posts:
  • Poor man’s 3d button with pure CSS

    April 18th, 2007

    How to compress your HTML websites with PHP

    You know bandwidth can cost a lot if you’re running a high bandwidth site. Other times you want to make your site as optimal in speed as you possibly can for the user to have a good experience when using your site.

    Some sites have a lot of text and content and it helps a lot to compress that output in the long run it is just a better experience for the end users and healthier for the internet in general.

    With PHP the easiest thing you can do after you have a website made, is to convert your HTML static site to PHP… You could simply rename it to .php in MOST cases but not all, and then add the following to the top of your file.

    Add to the top of your PHP code:

    <? ob_start(”ob_gzhandler”); ?>

    Thats it! Simple as pie :)

    You don’t have PHP on your website? Well *cough* blue chip hosting offers PHP for free to all members, we even have a free plan!

    Have fun!

    Powered by Gregarious (42)
    Share This now!


    Related Posts:
  • Compile Apache, PHP (With suhosin patch) + mod_perl
  • About
  • Make a button without an image editor using CSS!
  • How to disable ugly HTML image borders in links
  • Poor man’s banner / ad rotator

    April 18th, 2007

    How to disable ugly HTML image borders in links

    While this may seem very simple to those that know the answer, those that do not know may find it very useful.  It can make a very ugly situation for a beginner into something a lot prettier :)

    Original code:

    <a href=”http://www.bluechiphosting.com” mce_href=”http://www.bluechiphosting.com” title=”free web hosting”><img src=”image.jpg” mce_src=”image.jpg”>

    change code to:

    <a href=”http://www.bluechiphosting.com” mce_href=”http://www.bluechiphosting.com” title=”free web hosting”><img src=”image.jpg” mce_src=”image.jpg”>

    Hope it helps :)

    Powered by Gregarious (42)
    Share This now!


    Related Posts:
  • Poor man’s banner / ad rotator
  • Make a button without an image editor using CSS!
  • How to compress your HTML websites with PHP
  • Compile Apache, PHP (With suhosin patch) + mod_perl
  • Poor man’s 3d button with pure CSS

    « Previous Entries

    Archives

    Credits

    • Blue Chip Hosting - Quality Web Hosting





    Powered by Blue chip hosting
    Free web hosting Provided by www.bluechiphosting.com