Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , ,

Sponsored Links



How to use Colors in CSS?

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 09-02-2010
Flaco's Avatar
Member
 
Join Date: Aug 2006
Posts: 143
How to use Colors in CSS?

I am new to the CSS (Cascading Style Sheets). Before that I have done the C, C++ and Core Java. I have also done the HTML to some extent. I have used the colorful text and the background having different colors in HTML. But I don't know how to use Colors in CSS for Links.?? Since, I am new I don't know much about the scripts.!! So can anyone help me by providing some sample of scripts that are used for different colors. Also any other information related to same would be grateful.!! Please help me as soon as possible.
__________________
Technology is a way of organizing the universe so that man doesn't have to experience it.-- Max Frisch 1911 -1991
Reply With Quote
  #2  
Old 09-02-2010
Solitario's Avatar
Member
 
Join Date: Aug 2006
Posts: 220
Re: How to use Colors in CSS?

Since you are new, you should know exactly when to use the colors before seeing the coding. Once you get the proper concept of using that color, you can use it perfectly. Colors are accepted as as values, or part of their values by many of the Styles. They are accepted as color of background and border. In CSS there are five main ways to specify colors. You will also have to keep in mind that not to use the color names in your code, because they are non-standard. For giving the colors you will either have to use the HEX or RGB values.
__________________
I do to dead flowers what people at morgues do to dead people. Suck all the moisture out, dip them in plastic, paint them up pretty and put them in a nice frame.
Reply With Quote
  #3  
Old 09-02-2010
Member
 
Join Date: Nov 2008
Posts: 997
Re: How to use Colors in CSS?

In CSS, you can specify the colors in five main ways. In which, if you want to type the actual name of the colour, you can use the #rrggbb, #rgb the two rgb( ) syntaxes. The colors are defined in HEX, for the first two methods.

1. #rrggbb
  • If you want Red, you can use rr = 00 to ff.
  • If you want the color Green, then you will have to use gg = 00 to ff.
  • You can use bb = 00 to ff, for the Blue color.
For Example : You can use the #b85c4f.
2. #rgb
  • In this, if you want Red color, use r = 0 to f.
  • For Green color, you can use g = 0 to f.
  • If you want Blue color, then you use b = 0 to f.
For Example : #b54
Reply With Quote
  #4  
Old 10-02-2010
Member
 
Join Date: Nov 2008
Posts: 1,193
Re: How to use Colors in CSS?

If you have done the HTML, then you should know the basic colors. There are the 16 main HTML colors which are described below :
aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, orange, purple, red, silver, teal, white, yellow.
If you are using the CSS 3, then it defines many more colors. You can also use the inherit, which inherits the relevant color from the parent element. You can also make the backgrounds transparent.
Reply With Quote
  #5  
Old 10-02-2010
Viensterrr's Avatar
Member
 
Join Date: Jul 2006
Posts: 232
Re: How to use Colors in CSS?

According to me, if you want the description of rendering of HTML and XML documents on screen, then the CSS (Cascading Style Sheets) is the best and suitable language for that purpose. The CSS uses the color related properties and respective values, if you want to color elements in a document. You will have to remind that in the Color Module there must be at least two interoperable implementations for every feature. For using the color you can use the CSS <color> value type. I have provided you with a syntax, that refers to a 'text' attribute on a body element to set the color :
Code:
body { color: attr(text,color); }
__________________
Signatures reduce available bandwidth
Reply With Quote
  #6  
Old 10-02-2010
MELTRONICS's Avatar
Member
 
Join Date: Aug 2006
Posts: 226
Re: How to use Colors in CSS?

Before giving the colors to the links, you must know about the link properties. In CSS, there are four different selectors with respect to links :
  • link
  • visited
  • active
  • hover
Just like the normal text, you can specify whatever style you'd like to each of these selectors.
The following is an example for creating links that are both underlined and overlined.
Code:
<style type="text/css">
A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: none}
A:hover {text-decoration: underline overline; color: blue;}
</style>
__________________
3.2 (northwood)
2gig ram
ATI AIW X800xt 256mb
Gigabyte GA-8knxp 875p Chipset
Optiwrite 8X DVD Burner
Win XP PRO Sp2 (Works Perfectly)
2 SATA Raptor 74gig Raid 0
2 7200 IDE 320gig HD
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to use Colors in CSS?"
Thread Thread Starter Forum Replies Last Post
How to fix Missing Colors on Samsung TV Mahajabeen Monitor & Video Cards 2 13-04-2011 08:13 PM
How to mix colors in a photos Langward Windows Software 4 28-02-2010 05:59 AM
HD 4850 strange colors jean-paul martell Monitor & Video Cards 5 20-03-2009 04:33 PM
Set colors in echo revolucioncg Software Development 3 14-02-2009 09:53 PM
Colors on the Macbook screen T0tal L0$$ Customize Desktop 2 10-02-2009 06:22 PM


All times are GMT +5.5. The time now is 11:15 AM.