Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7627015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:24:12+00:00 2026-05-31T05:24:12+00:00

I’m trying to use CSS block links in my web site. I want to

  • 0

I’m trying to use CSS block links in my web site. I want to have light background with white fonts when the link is passive and dark background with white fonts when you hover over the link or if the link is active (the left button pressed but not released). And I don’t want the font color to change. I’ve tried this on IE9, FF 7, Chrome 17 with the following code:

<!--
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<<style type="text/css">
a.header:link {
text-align:center;
display:block;
font-weight:bold;
font-color:white;
background:lightgreen;
width:112px;
text-align:center;
padding:4px;
text-decoration:none;
outline-style:double;
outline-color:green;
}
a.header:hover,a:active {
background-color:darkgreen;
text-align:center
font-color:white;
}
</style>
</head>
<body>
<div><h1><a class="header" href="http://www.vk.com">www 999</a></h1></div>
</body>
</html>

Unfortunately the code’s behaviour is unpredictable. Font color is always dark (I want white), sometimes red if the link is active and the background is changing different way on different browsers
Can somebody help me to make this work the same way on popular browsers?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:24:13+00:00Added an answer on May 31, 2026 at 5:24 am
    • There is no such thing as font-color. The name of the property is color.
    • You have an extra < before <style.
    • You shouldn’t put your DTD in a comment; that defeats the point.
    • There’s a missing semicolon after text-align: center.
    • You probably don’t want to specify :link; that will only apply to links that are neither visited, hovered nor active.

    Here’s a demo with all the fixes on JSBin, because jsFiddle is down.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the CSS word-wrap property with break-word value. I want to
I'm trying to use the background-image css property with a website I'm building with
So I am trying to use the CSS hack to set the max-height for
I'm trying to use jquery and blueprint css to do a (so i thought)
I am trying to use jQuery to basically wrap a bunch of CSS modifications
I am trying use gem tire to search in my application. I have tables
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I am trying to put a link in a <th> element and have the
I am trying to use jQuery(document).ready(function () { if (!jQuery.browser.msie <= 7.99) { jQuery('#element').css('display',
I'm trying to use jQuery to show an image that I have set to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.