LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-27-2011, 12:46 PM   #1
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Rep: Reputation: 39
Changing the font color in a CSS file


Hi there --

I am working with a template.css file, and I want to change the color of the font in part of the header from black to blue.

The code for the header section in question is shown below:

Code:
h2 {
font-size:1.2em;
line-height: 1.3;
font-family: Times New Roman, Arial, Verdana, Helvetica, sans-serif;
letter-spacing: 0px;
font-weight: bold;
text-align: left;
}

#logo h2 {
  line-height: 1.1;
  font-size: 60px;
  font-family: Times New Roman, Arial, Verdana, Helvetica, sans-serif;
  font-weight: bold;
  letter-spacing: 0px;
  margin: 12px 0 0 0px;
  padding: 0;
}
Is there syntax that can be inserted into the file to accomplish this? Thanks.
 
Old 04-27-2011, 12:52 PM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
You could add the following:

Code:
color: #0000ff;
I don't know the structure of your markup code so it's hard to guess which part of the header should have blue fonts.
If you add it to h2, all h2 element will be blue. If, on the other hand you add it to #logo h2, only h2 elements in the 'logo' div will be blue.

HTH

Last edited by sycamorex; 04-27-2011 at 12:55 PM.
 
Old 04-27-2011, 01:47 PM   #3
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Original Poster
Rep: Reputation: 39
Hi there --

Thanks for your reply. I applied the syntax in question to the logo h2 group so that it reads as follows:

Code:
#logo h2 {
  line-height: 1.1;
  font-size: 60px;
  font-family: Times New Roman, Arial, Verdana, Helvetica, sans-serif;
  font-weight: bold;
  color: #0000ff;
  letter-spacing: 0px;
  margin: 12px 0 0 0px;
  padding: 0;
}
I want just the logo h2 division to have the blue font so that is why I applied it to that section. Anyway, the addition of the color line did NOT make a difference. I have included a copy of the template.css file for your perusal. Maybe you can see something that I am missing here.

Thanks.
Attached Files
File Type: txt template.css.txt (22.2 KB, 16 views)
 
Old 04-27-2011, 03:20 PM   #4
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Can you post (or PM me) the html file? I'd be happy to try to help you.
 
Old 04-27-2011, 03:44 PM   #5
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Original Poster
Rep: Reputation: 39
Hi there --

Sure. The attachment to this e-mail is the front page. If you have any questions, please let me know.

Thanks for the help.
Attached Files
File Type: txt HOME.html.txt (8.5 KB, 17 views)
 
Old 04-27-2011, 04:14 PM   #6
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Code:
<div id="logo" class="gainlayout">
<h2>
<a title="CTAG" href="http://domain.com">CTAG</a>
</h2>
<h3>Clinical Trials Advisory Group</h3>
</div>
Ok, a few things:

I assume you are talking about "CTAG". In that case, you'd have to include:

Code:
#logo a:link, a:visited, a:active, a:hover {text-decoration: none; color: #0000ff;}
It's actually referring to a link (<a></a>) not h2 so styling h2 wouldn't make any difference as links seem to be defined in some other stylesheet (general.css?)

That is why, the above css code is probably not going to work because you use other stylesheets that might overwrite this value.

Let's see.

If not, you'd have to post other stylesheets. Your website's base url doesn't seem to be accessible.

Last edited by sycamorex; 04-27-2011 at 04:29 PM.
 
Old 04-27-2011, 04:43 PM   #7
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Original Poster
Rep: Reputation: 39
Hi there --

The base URL for the website is the following:

Code:
http://radtrials.mgh.harvard.edu
I checked the directory where the template.css file is located. This directory is affiliated with the template, a4joomla, used on the website. There was no general.css file at that location, but there are the following:

Quote:
grey.css
ie67.css
ie6.css
index.html
print.css
template.css
I did a search for a general.css file, and there is one located in another directory. I have taken the liberty of including it with this posting.
Attached Files
File Type: txt general.css.txt (2.7 KB, 20 views)
 
Old 04-27-2011, 04:50 PM   #8
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
The url is inaccessible for me.

Have you tried what I posted above?

It isn't in general.css. Can you check if any of other stylesheets specifies rules for "a:link"?
 
Old 04-27-2011, 05:19 PM   #9
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Original Poster
Rep: Reputation: 39
I got it...with your help of course...;-)

First off, try this URL:

Code:
hadron.mgh.harvard.edu
Secondly, I did a search for the a:link text in the css files within the directory. I got a hit on the grey.css file.
After making a backup copy of the file, I did a search for the h2 text. I came across the following:

Code:
#logo h2 a:link, #logo h2 a:visited, #logo h2 a:hover, #logo h2 a:active {
color: #33CCFF;
text-decoration: none;
}
The color text, which is shown in its final form, was set to #000. Once I made the change there, and a similar one to the logo h3 section, the color that I wanted appeared on the page. See if you can get to the URL listed, and let me know what you think.

In any event, this one will definitely get documented without fail.
 
Old 04-27-2011, 05:44 PM   #10
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Glad you got it working.

Unfortunately, I still can't access your website.

Is it possible that it's only accessible from within the harvard network?

Last edited by sycamorex; 04-27-2011 at 05:45 PM.
 
Old 04-27-2011, 05:54 PM   #11
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Original Poster
Rep: Reputation: 39
Hi there --

That website is accessible from the Web. Just to confirm the URL is the following:

http://hadron.mgh.harvard.edu

I will look further into the matter, but in any event thanks again for the help.
 
Old 04-27-2011, 05:55 PM   #12
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Nope, I'm afraid I can't access it.

No problem.
 
Old 04-27-2011, 06:02 PM   #13
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Original Poster
Rep: Reputation: 39
Are you getting a connection timeout or refused error? If so, you may be on a subnet that is being blocked...don't ask.

If you can tell me what your address is, I can go see.
 
Old 04-27-2011, 06:15 PM   #14
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Quote:
Originally Posted by kaplan71 View Post
Are you getting a connection timeout or refused error? If so, you may be on a subnet that is being blocked...don't ask.

If you can tell me what your address is, I can go see.
It's a connection timeout.

OMG, what have I done?!


I can't access the website from my smartphone either.

Both are on 93.x.x.x
 
Old 04-27-2011, 06:19 PM   #15
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Original Poster
Rep: Reputation: 39
Smile

Ok...try it now...and how is weather in Amsterdam?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing font color during boot screen (not GRUB, not KDM) Frank64 Linux - General 0 01-25-2010 02:29 PM
Changing font color during bootup Dr. Psy Slackware 1 12-16-2006 01:03 AM
Changing Terminal background colour and font color dpbatagoda Linux - Newbie 0 12-05-2003 12:38 AM
Changing font color in init3 psyklops Linux - General 7 08-25-2003 01:45 AM
Changing font color uglyvorys Linux - General 2 02-02-2003 12:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration