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]

1Accespted Gradient Text Using CSS Sat Jun 26, 2010 12:50 am

Nem

Nem
Registered Member
Registered Member
Gradient Text Using CSS
Apply gradient effect to text with CSS


This tutorial will purely focus on using css to apply a gradient effect to your text.
How this works is simply by adding a 1px gradient png (with alpha transparency) over the text.

The HTML markups:
Code:
<h1><span></span>CSS Gradient Text</h1>

For css the key points are: h1 { position: relative } and
h1 span { position: absolute }

Code:
h1 {
  font: bold 330%/100% "Lucida Grande";
  position: relative;
  color: #464646;
}
h1 span {
  background: url(gradient.png) repeat-x;
  position: absolute;
  display: block;
  width: 100%;
  height: 31px;
}

and that's it!

This will only work for solid background colors. Also your gradient image (png) must be the same color as your background.
If your gradient image is taller then the heading, the text will not be selectable.

If you want to test it out go to http://webartzeditor.tk and put in the css and html codes and replace the "gradient.png" with this image:
https://i.servimg.com/u/f68/15/18/69/86/gradie12.png

and have fun with it! Very Happy


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



Last edited by Nem on Sun Jun 27, 2010 9:43 pm; edited 1 time in total

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

2Accespted Re: Gradient Text Using CSS Sun Jun 27, 2010 10:26 am

ankillien

ankillien
Administrator
Administrator
Hi Nem!

The tutorial looks good.
I suggest you to replace the HTML editor link with http://webartzeditor.tk

Thank you Very Happy

3Accespted Re: Gradient Text Using CSS Sun Jun 27, 2010 12:05 pm

Nem

Nem
Registered Member
Registered Member
Thanks ankillien, and about the link, the editor I posted has css and html combined, with only html you couldn't test the gradient properly. If I'm mistaken tell me and I'll change it Very Happy

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

4Accespted Re: Gradient Text Using CSS Sun Jun 27, 2010 2:01 pm

ankillien

ankillien
Administrator
Administrator
Nem wrote:Thanks ankillien, and about the link, the editor I posted has css and html combined, with only html you couldn't test the gradient properly. If I'm mistaken tell me and I'll change it Very Happy

WebArtz editor supports both HTML and CSS.
So, why to use external editor while we have our own? Very Happy

5Accespted Re: Gradient Text Using CSS Sun Jun 27, 2010 9:43 pm

Nem

Nem
Registered Member
Registered Member
*edited* Very Happy

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

6Accespted Re: Gradient Text Using CSS Mon Jun 28, 2010 11:47 am

Nem

Nem
Registered Member
Registered Member
Is this gonna be accepted Question

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

7Accespted Re: Gradient Text Using CSS Mon Jun 28, 2010 5:13 pm

ankillien

ankillien
Administrator
Administrator
Yes, it is Very Happy
Thank for your contribution.

Tutorial Accepted

8Accespted Re: Gradient Text Using CSS Mon Jun 28, 2010 5:26 pm

Fred100

Fred100
Registered Member
Registered Member
Umm , anki , webartz code editor , doesn't allows that , I just tried to see the outcome , and what I saw was the codes being shown as it is Sad , and Umm Nem , can you give me a demo of how it looks like?

http://www.art-castle.biz/forum.htm

9Accespted Re: Gradient Text Using CSS Mon Jun 28, 2010 5:39 pm

ankillien

ankillien
Administrator
Administrator
Fred,

I've just tried and it works.
Try putting the CSS codes in <style></style> tags and put the HTML code below it. Don't forget to put the gradient image URL in the CSS code.
It will show up.

10Accespted Re: Gradient Text Using CSS Mon Jun 28, 2010 5:59 pm

Fred100

Fred100
Registered Member
Registered Member
Okay , I'll try adding the style tags then , and yes of course , I'm not that dum' that I won't put the image , I do read tutorials till the end lol

*edit*
Oh yay , it works , but yeah , just cause it's in white , I couldn't see anything as the background is also white in the webartz editor Razz

http://www.art-castle.biz/forum.htm

11Accespted Re: Gradient Text Using CSS Mon Jun 28, 2010 6:05 pm

ankillien

ankillien
Administrator
Administrator
You can change background with this code...

Code:
body {
background : #333;
}

12Accespted Re: Gradient Text Using CSS Mon Jun 28, 2010 6:18 pm

Fred100

Fred100
Registered Member
Registered Member
Thanks anki , and Nem , both helped , but the image you gave for trial...I can't see it properly Sad

http://www.art-castle.biz/forum.htm

13Accespted Re: Gradient Text Using CSS Mon Jun 28, 2010 7:11 pm

Nem

Nem
Registered Member
Registered Member
Hmm, that's because is a gradient white image and it blends in with the background. If you try selecting the whole page it'll outline. Also it's really small, but it works for big font too Very Happy

*edit* so don't bother looking for the image, just simply copy the url :]

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

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