Google Answers Logo
View Question
 
Q: for andyt only ( Answered 5 out of 5 stars,   0 Comments )
Question  
Subject: for andyt only
Category: Computers > Programming
Asked by: cereb-ga
List Price: $2.00
Posted: 20 Oct 2004 07:07 PDT
Expires: 19 Nov 2004 06:07 PST
Question ID: 417514
In the page you delivered Oct 10, I wanted a text color different fom
the title color.  I see that you used one color for all body content. 
Would you augment the style sheet you created so that I can assign a
color to any text, or portions of text, and to any
titles/sub-titles/headers?
Answer  
Subject: Re: for andyt only
Answered By: andyt-ga on 20 Oct 2004 15:59 PDT
Rated:5 out of 5 stars
 
Hi cereb,
I'd be happy to modify the css sheet for you; however unless you can
give me some specifics about which colors, and which text sections you
want colored, I think it's best to explain to you how to do it.

To create a new color for any portion of text, first you create a css
class, with a color selector like this (and put it in the style.css
file:


.red	{
	color: #FF0000;
}

This color selection works in any css class, so you can add it to the
classes that are already there, or create new ones.

Then, when you want to use the red color in your text, you just modify
the tags surrounding that text to point to that class, such as:
<p class ="red">This is red text</p>

Here's a useful reference for color codes:
http://webmonkey.wired.com/webmonkey/reference/color_codes/

Here's a fairly good tutorial for css.  I refer to it when doing
tricky stuff all the time:
http://www.w3schools.com/css/default.asp

If I can help in any other capacity, or if this answer is unclear,
feel free to request a clarification.

--andyt-ga

Request for Answer Clarification by cereb-ga on 21 Oct 2004 01:39 PDT
Thank you, Andyt, for the hints.  I went to the w3 link and tried
several candidate solutions.  They may well be solutions and I don't
implement them properly, so here I want to comment on the particular
issue I am facing.  Using headers such as h4, leaves a space between
that header and the text that follows.  That is ok in most instances,
but I have some sub-sub-headers where I want that header to "sit" on
top of the text that follows.  That means that I need to speficy the
color for the header as well as its size.  I used {display: inline} in
combination with h4 and color:#660000, for example, but the desired
results did not materialize, nor did a few other options I tried
succeed.

There are only two colors for any text in the sample I gave before:
#660000 for any headers, such as h4, or text with different font size
and color designations that then become effective headers or labels. 
And the other color is #990000 for the bulk of the text.

If that makes sense to you, I would greatly appreciate it if you could
modify the style sheet with whatever can yield the desired effect.

Clarification of Answer by andyt-ga on 21 Oct 2004 12:15 PDT
You were definitely on the right track with display:inline.  I made a
couple changes to the style.css file, and the sample.php file to
illustrate the changes:

h1, h2, h3, h4, h5, h6 /*this changes all headers to #660000 color by default */
{
	color:#660000;
}

.inline	{ /*this makes any element using this class display inline */
	display:inline;
}

To sample.php I added:
<h4 class="inline">Header text</h4>
<p>new paragraph here....</p>


You can view the document at http://tunebounce.com/answers/417514/sample.php
and download the zip at http://tunebounce.com/answers/417514/mundi-causa.zip

Let me know if this is what you were looking for.

--andyt-ga
cereb-ga rated this answer:5 out of 5 stars and gave an additional tip of: $5.00
Andy - your response is great, thanks.  Sorry for the delay in closing this.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy