Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 5th, 2011, 02:23 PM
Authorized User
 
Join Date: Jun 2011
Posts: 45
Thanks: 2
Thanked 0 Times in 0 Posts
Smile Chap 3, pg 88, #6

How can any browser show the initial css color setting of Green (#080000) on my hyperlink? Any browser I use, IE9, Firefox, Safari, Chrome all default to the Red setting.
Hover works correctly, but the only other color displayed is Red.

Even after clearing all the browser cache settings and even restarting VWD 2010, the browsers still show Red.

I have even tried overridding the forground color in Design to other initial colors without success.

Do you have an idea as to what I'm doing wrong?

I know it's something simple, but I have spent 1.5 hrs trying to resolve this little problem. Sorry to bother for such an insignificant issue.

Jack Koyle
Michigan
 
Old December 5th, 2011, 02:33 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Jack,

Can you post your code? There must be a simple explanation...

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old December 5th, 2011, 02:46 PM
Authorized User
 
Join Date: Jun 2011
Posts: 45
Thanks: 2
Thanked 0 Times in 0 Posts
Smile Chap 3, pg 88, #6

Default.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!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 runat="server">
<title></title>

<link href="Styles/Styles.css" rel="stylesheet" type="text/css" />

<style type="text/css">
.style1
{
color: #0080FF;
}
</style>

</head>
<body>
<form id="form1" runat="server">
<div id="PageWrapper"></div>
<div id="MainContent">
<h1><a href="Default.aspx" class="style1">1-888-Referral</a></h1>
<p>A Customized Referral Service Specifically Designed for the Dental Specialist and the Referring Office.</p>
<p>You will never miss another Referral</p>
</div>
<div id="Sidebar">Sidebar Goes Here</div>
<div id="Footer">Footer Goes Here</div>

</form>
</body>
</html>



Styles/Styles.css

#Header
{
background-color: #C0C0C0;
width: 844px;
height: 175px;
}

*
{
font-family: Arial;
}

h1
{
font-size: 21px;
}

#PageWrapper
{
width: 844px;
}

#MenuWrapper
{
width: 844px;
}

#MainContent
{
width: 664px;
float: left;
}

#Sidebar
{
background-color: Gray;
width: 180px;
float: left;
}

#Footer
{
background-color: #C0C0C0;
width: 844px;
clear: both;
}

#MainContent a
{
color: #008000; /* Green */
text-decoration: underline;
}

#MainContent a:visited
{
color: #FF0000; /* Red */
text-decoration: underline;
}

#MainContent a:hover
{
color: #FFA500; /* Orange */
text-decoration: underline;
}
 
Old December 5th, 2011, 02:57 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

indeed. Take a look at this:

Code:
 
CodeFile="Default.aspx.vb
and this
Code:
 
<a href="Default.aspx" class="style1">
You run this code in a page called Default.aspx. By browsing to it, you visit it. The link will then be rendered with a:visited class according to CSS rules.

Change the link something that doesn't exist yet or that you haven't visited yet (Whatever.aspx should do the trick) and it'll work.

You may also need to remove the inline style1....

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
jkoyle (December 5th, 2011)
 
Old December 5th, 2011, 03:10 PM
Authorized User
 
Join Date: Jun 2011
Posts: 45
Thanks: 2
Thanked 0 Times in 0 Posts
Smile Chap 3, pg 88, #6

THANK YOU:

Absolutely Perfect. I knew it was something simple.

God Bless You

Jack Koyle





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chap. 4, Pg 121-123 tompp BOOK: Beginning ASP.NET 4 : in C# and VB 6 August 26th, 2011 01:33 PM
Try it Now, Chap. 4, Pg 123 jefals BOOK: Beginning ASP.NET 4 : in C# and VB 8 May 9th, 2011 11:41 AM
BasePage (Chap 4 pg 98) NetWorld BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 1 November 25th, 2010 02:39 PM
Chap 15 pg 532 tomche BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 10 April 2nd, 2010 03:37 PM
return *this - Chap 8 pg 418 proslambano BOOK: Ivor Horton's Beginning Visual C++ 2005 0 March 10th, 2007 01:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.