Jump to content

About text color changed


satimis
 Share

Recommended Posts

Hi folks,I created following webpage for testing.

<?xml version="1.0"?>  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  <html xmlns="http://www.w3.org/1999/xhtml"  xml:lang="en" lang="en">	<head>	  <style type="text/css" title="Default-Style">		body { 	background-image: url("aaa.jpg");		background-position: 50% 50%;		background-repeat: no-repeat;		background-attachment: fixed;	margin: 15em 5em;		font-family: "tahoma", Arial, Helvetica, sans-serif;		font-size: 25px;		}		h1 {color: red;text-align:center;}		h2 {color: blue;text-align:center;}	h3 {color: green;text-align:center;}	  </style>	  <meta http-equiv="Default-Style" content="Default-Style" />	  <meta name="generator" content="I am proud to have created my own page from scratch in Notepad." />	  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />	  <title>Web Testing!</title>	</head>  <body>	<h1><b><i>Web Testing</h1></b></i>	<h2><b><i>"Web Testing"</i> Testing is important.<p>The tool used is on "Internet".<p><p><font size="8" face="arial" color="red">Take a tour !!!</font></h2></b>  </body>  </html>

The webpage displayed meets my expectation. The main text is blue color.However if I add the links as follow:

<?xml version="1.0"?>  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  <html xmlns="http://www.w3.org/1999/xhtml"  xml:lang="en" lang="en">	<head>	  <style type="text/css" title="Default-Style">		body { 	background-image: url("aaa.jpg");		background-position: 50% 50%;		background-repeat: no-repeat;		background-attachment: fixed;	margin: 15em 5em;		font-family: "tahoma", Arial, Helvetica, sans-serif;		font-size: 25px;		}		h1 {color: red;text-align:center;}		h2 {color: blue;text-align:center;}	h3 {color: green;text-align:center;}	  </style>	  <meta http-equiv="Default-Style" content="Default-Style" />	  <meta name="generator" content="I am proud to have created my own page from scratch in Notepad." />	  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />	  <title>Web Testing!</title>	</head>  <body>	<h1><b><i>Web Testing</h1></b></i>	<h2><b><a href="/bbb.com/Web_Testing"><i>"Web Testing"</i></a> Testing is important.<p>The tool used is on<a href="http://bbb.com/Testing_tools"><i>"Internet".</i></a><p><p><font size="8" face="arial" color="red">Take a tour !!!</font></h2></b>  </body>  </html>

The color of the text "Web Testing" and "Internet' becomes violet. I couldn't discover the cause. Please help. TIAB.R.satimis

Edited by satimis
Link to comment
Share on other sites

Sounds like the default styling for visited links. Try something like this:a:visited {color: blue; /* or whatever color you need */}
Hi,After adding
<font color=blue>  </font>

between "Web Testing" as well as "Internet" then it works. The complete text is in blue. Thankssatimis

Link to comment
Share on other sites

Except that the <font> tag is deprecated and should be avoided. Did you try my suggestion?
Yes, I tried but couldn't figure out where is the correct place to put "color:blue;"< a href="//...... color:blue><a href="//..... color:blue;><a href="//....{color:blue;}>etc.all without effect.B.R.satimis
Link to comment
Share on other sites

Shadow showed you the correct syntax for a CSS stylesheet. You HAVE a stylesheet at the top of your document. Put the code there.
Yes I got it done.Put
a:visited {color: blue; /* or whatever color you need */}

just under;

<style type="text/css" title="Default-Style">

Thankssatimis

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...