WebArtz - The Web Design Forum
Welcome to WebArtz, Guest!

WebArtz is a nice place for discussions related to web designing and coding. We help our members to code their own website templates with HTML and CSS. We give them advice on various issues.

To know more about WebArtz Forum, visit the About Us page.

At the moment, you are viewing the forum as a guest. As a guest you can't make post and participate in discussions. You need to register and become a member of the forum. Click the register link below and become a part of this forum.

Thank You

WebArtz - The Web Design Forum
Welcome to WebArtz, Guest!

WebArtz is a nice place for discussions related to web designing and coding. We help our members to code their own website templates with HTML and CSS. We give them advice on various issues.

To know more about WebArtz Forum, visit the About Us page.

At the moment, you are viewing the forum as a guest. As a guest you can't make post and participate in discussions. You need to register and become a member of the forum. Click the register link below and become a part of this forum.

Thank You


You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1CSS3 Gradients Empty CSS3 Gradients Thu Dec 16, 2010 12:06 am

RockerMan

RockerMan
Technician
Technician
CSS3 Gradients
CSS gradient property for beginners


OK so today we are going to discuss CSS3 Gradients and how to master them. They can be a little confusing to asomeone who is just starting in CSS. Follow this guied and you should be fine Smile

OK so lets have a look at the code:
Code:

#linearBg2 {
  height: 100px;
  background-color: #1a82f7; /*IE Fall Back*/
  background: url(images/linear_bg_2.png);/*Another IE Fall Back*/
  background: -moz-linear-gradient(100% 100% 90deg, #2F2727, #1a82f7);
  background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#1a82f7), to(#2F2727));
}

OK so unfortunatly the code look nothink alike, as you may know WebKit
is the following browsers:

  • Safari
  • Google Chrome
  • Opera
  • There is others but they are no where near as popular


And of course is Mozilla (Firefox Only).

Now a quick explination why we have to use the Moz tag, if we just use linear-gradient Firefox will not pick it up as it requiers you to reference that you want to apply it to Firefox.

Quick Tip:
IE doesn't support CSS3 as of yet, so we must alway provide a fall back option, see the code for more details on this. IE 9 is due to be released fully soon. Then it will support it Smile

OK now to the ponint....

Firefox first Smile

-moz-linear-gradient(100% 100% 90deg, #2F2727, #1a82f7);


  • We've already coverd this, you need to refrence the browser and what you want to do, in this case its a linear gradient for Firefox.
  • OK so this is refrencing that we want a 90 degree gradient from bottom to top 100% specifying the belnd mix, like color stops in Photoshop
  • This is the bottom color, choose your color in a color picker and insert you HEX here.
  • Exactly the same as above but this is the top color


OK now WebKit Browsers....

-webkit-gradient(linear, 0% 0%, 0% 100%, from(#1a82f7), to(#2F2727))


  • Again this is just to refrence the browser and to tell it you want a gradient
  • Now this is a little diffrent isn't it? Don't worry though WebKit just needs you to put in into the code rather then the selector
  • Again these are just color stops, we will cover these in a further more comprehensive tutorial
  • Self explanatory really, from what color would you like to from.....
  • and to what color to. Very easy Smile


Don't forget to check you brackets, it won't work if you dont!

Thanks For Reading Very Happy
Rob


Notice : This tutorial is copyrighted by WebArtz Forum. You may not publish it on anywhere without written permission from the administrators.







Last edited by RockerMan on Wed Jan 05, 2011 10:34 pm; edited 1 time in total

http://www.graphics-post.com/

2CSS3 Gradients Empty Re: CSS3 Gradients Sat Dec 18, 2010 10:09 pm

ankillien

ankillien
Administrator
Administrator
Tutorial Accepted

3CSS3 Gradients Empty Re: CSS3 Gradients Tue Dec 06, 2011 2:42 am

Guest


Guest
Nice tutorial Rocker! Congratulations! Wink

Sponsored content


View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum