0

I've got a html page with styling in the <style></style> tags in the header and a php block with some includes in the body.

At the very top i've got this:

a:link {color: inherit;}      /* unvisited link */
a:visited {color: inherit;}  /* visited link */
a:hover {color: inherit;}  /* mouse over link */
a:active {color: inherit;}  /* selected link */

In the navigation bar (one of the php includes) i've got this:

a:link {color:white; text-decoration:none;}      /* unvisited link */
a:visited {}  /* visited link */
a:hover {text-decoration:underline;}  /* mouse over link */
a:active {}  /* selected link */

And the problem is i've got some <a href> email links on the same page under the php includes which are turning white, on a white background. How can I override the included php file so my email links can be black while keeping the white navigation bar links?

Loading Sequence:

  1. Inline style
  2. Body
  3. php includes
  4. The <a href> emails links which are turning white
Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
Crizly
  • 971
  • 1
  • 12
  • 33

3 Answers3

2

When you do an PHP include, it is basically just dumping that HTML into the document. So you need to either make the link a class like the individual above me stated (and add that class into your CSS document) or you need to use some inline CSS to overwrite the general rule set in your CSS document. This inline CSS would need to be in that PHP file itself that you are including.

Allison Wilson
  • 250
  • 3
  • 15
0

Give the email links a class

html

 <a href="" class="email_link"></a>

css

.email_link{
  color: #000!important;
 }
Denzyl Dick
  • 293
  • 3
  • 11
0

sometimes if you lost in seeking the right place to change the css, change it inline. using:

<a href="#" style="color:blue"> link </a>