Results 1 to 6 of 6

Thread: How to use Colors in CSS?

  1. #1
    Join Date
    Aug 2006
    Posts
    162

    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

  2. #2
    Join Date
    Aug 2006
    Posts
    227

    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.

  3. #3
    Join Date
    Nov 2008
    Posts
    996

    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

  4. #4
    Join Date
    Nov 2008
    Posts
    1,192

    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.

  5. #5
    Join Date
    Jul 2006
    Posts
    289

    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

  6. #6
    Join Date
    Aug 2006
    Posts
    235

    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

Similar Threads

  1. Replies: 5
    Last Post: 09-04-2012, 05:12 PM
  2. Different colors available for HTC Desire S510e
    By Ramamurti in forum Portable Devices
    Replies: 6
    Last Post: 19-08-2011, 06:41 PM
  3. Sony Z12 colors are blown out
    By Lambodar in forum Portable Devices
    Replies: 6
    Last Post: 01-10-2010, 12:09 AM
  4. How to mix colors in a photos
    By Langward in forum Windows Software
    Replies: 4
    Last Post: 28-02-2010, 05:59 AM
  5. Set colors in echo
    By revolucioncg in forum Software Development
    Replies: 3
    Last Post: 14-02-2009, 09:53 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,535,948.51228 seconds with 17 queries