+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Gradiant effect in CSS

  1. #1
    justnajm's Avatar
    justnajm is offline x10Hosting Member justnajm is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    15

    Gradiant effect in CSS

    How can I create gradiant effect in CSS without any image, as with image the page becomes to heavy for friends with low internet connection.

    Basically it is said to be the effect in which two or more color are mixed together in a manner that each one of the colour fade in the other and so on.

    Thanks Alot

  2. #2
    2dots's Avatar
    2dots is offline x10Hosting Member 2dots is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    New Jersey, USA
    Posts
    6

    Re: Gradiant effect in CSS

    you can use alpha filters but those only work on IE...
    why not an image? you can make gradient pngs, that are less than 5k..
    can you be a bit more specific on the design?

    Thanks

  3. #3
    shaunak's Avatar
    shaunak is offline x10 Lieutenant shaunak is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    3rd rock from the sun
    Posts
    317

    Re: Gradiant effect in CSS

    The trick most sites use is to use a tiny image, a 500px*5px image which loads very very quickly, even on dial up. With png's you can achieve this in ~0.5Kb's or less.

    Use a constant background colour say alice blue #f0f8ff and in a new transparent layer photoshop or GIMP make a 500px*5px image which fades from say #000070 [midnight blue] to transparent.
    Then use:
    background: #f0f8ff url(images/bground.png) top left repeat-x;

    This works with fair efficiency even on mobile phone browsers.
    And even if the image dosnt load, at least the Alice blue is visible.

    -hope this helps!

    ps: I think you can archive 100% no images with svg's and xml. i am not sure though.
    Cheers,
    Shaunak

  4. #4
    justnajm's Avatar
    justnajm is offline x10Hosting Member justnajm is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    15

    Re: Gradiant effect in CSS

    thanks shaunak, its really gr8 technique, what it is said to be .....

    It will be extremely fast then the whole image. Thanks again

  5. #5
    randomdood is offline x10Hosting Member randomdood is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    3

    Re: Gradiant effect in CSS

    why not just make the image 1px high, thats what i did and it works fine in all browsers and it saves even more bandwidth and loading time.

  6. #6
    DarkDragonLord's Avatar
    DarkDragonLord is offline x10 Elder DarkDragonLord is an unknown quantity at this point
    Join Date
    Mar 2007
    Location
    Brazil
    Posts
    782

    Re: Gradiant effect in CSS

    but using alpha png's dont work with old IE's.
    How can we fix that ? i know of pngbehavior.htc + using a blank.gif but that never worked with a background png
    Regards,
    Raphael DDL

    Designing Solutions for You
    *Web Design;
    *Coding;
    Free Downloads;
    and all related Stuff
    .


    My Tutorials:
    | Multi-Language Websites | Rotative Banners |
    | Bookmark Script for All Browsers
    |
    |
    PHP Switching/Including Content|
    |


  7. #7
    Pingy's Avatar
    Pingy is offline x10Hosting Member Pingy is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    46

    Re: Gradiant effect in CSS

    Well, an alpha channel isn't exactly necessary for a gradient, is it?

  8. #8
    2dots's Avatar
    2dots is offline x10Hosting Member 2dots is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    New Jersey, USA
    Posts
    6

    Re: Gradiant effect in CSS

    @DarkDragonLord
    there are some .js scripts out there that will allow you to use transparent
    (not just gradient) pngs with older IE versions...
    for example here is one i've used in the pasthttp://homepage.ntlworld.com/bobosola/index.htm

  9. #9
    shaunak's Avatar
    shaunak is offline x10 Lieutenant shaunak is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    3rd rock from the sun
    Posts
    317

    Re: Gradiant effect in CSS

    Quote Originally Posted by randomdood View Post
    why not just make the image 1px high, thats what i did and it works fine in all browsers and it saves even more bandwidth and loading time.
    But then it becomes difficult to edit the image in a image editor.
    A minor tilt in the gradient causes "hills" to form in the rendered image.

    If you can manage on 1 px, nothing like it, but if you cant 5px is not that bad.
    Cheers,
    Shaunak

  10. #10
    dyfuse's Avatar
    dyfuse is offline x10 Sophmore dyfuse is an unknown quantity at this point
    Join Date
    Apr 2006
    Posts
    196

    Re: Gradiant effect in CSS

    Hey all,

    I just found this page that shows a gradient created purely from CSS!

    CSS Gradients Demo: http://www.designdetector.com/2005/0...ients-demo.php

    You can try some different colors yourself and view the source code to see how it was done!

    However, it is impossible to make a functional webpage from it. The technique uses <div> elements to create the effect, meaning that it is impossible to put text over it.

    Oh well, worth a look at anyway

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. open_basedir restriction in effect?
    By waveking in forum Free Hosting
    Replies: 5
    Last Post: 06-12-2006, 07:59 AM
  2. Adobe Photoshop: Abstract Crystal Ice Effect
    By pulse__xx in forum Tutorials
    Replies: 7
    Last Post: 11-20-2005, 09:56 AM
  3. crytal or shiny effect?
    By subvertman in forum Graphics & Webdesign
    Replies: 11
    Last Post: 08-30-2005, 06:32 AM
  4. change doesn't have effect
    By Md. Tanvir Al Amin in forum Free Hosting
    Replies: 0
    Last Post: 06-09-2005, 12:16 PM
  5. Pop art effect
    By Ericsson in forum Graphics & Webdesign
    Replies: 8
    Last Post: 04-02-2005, 09:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers