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 June 19th, 2015, 04:43 PM
Registered User
 
Join Date: Jun 2015
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default p91 problem with css

I am stuck on making the text in the main content area the correct colours according to the css. I have followed the examples in the book and checked my code but the visited and underline links dont show the correct colours. When visited I find that when I test the website the "look around" text is purple instead of red. If I delete my browsing history from Chrome it reverts to blue instead of green and then when I click it becomes purple instead of red. The hover mode never works at all though.

Bit strange as Ive followed the example from the book, I tried going to other websites and found blue and purple are the standard colours as if some setting on my pc is making them this way, why is it ignoring the css?
 
Old June 25th, 2015, 03:39 AM
Authorized User
 
Join Date: May 2015
Posts: 46
Thanks: 1
Thanked 0 Times in 0 Posts
Default

double click on the word you want to convert it to the hyperlink and go to the format in the tool bar click on (convert to hyperlink) and then press on browse button to chose that page you want
to appear underline when put the mouse on the link go to the css file >>>type
a:hover
{

text-decoration : underline;
}


--------
sorry my English language very bad
I hope this help

Last edited by SHOOGN; June 25th, 2015 at 03:43 AM..
 
Old June 25th, 2015, 02:42 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Can you post the CSS for the page? Maybe there's something wrong there?

Also, try a different browser and see if the behavior is different there?

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 June 28th, 2015, 02:42 PM
Registered User
 
Join Date: Jun 2015
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have tried using Internet Explorer as well as Chrome and found the same behaviour.

Here is the Css :

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

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

#MainContent a:hover
{
color: #FFA500;
text-decoration: underline;
}

And here is the default.aspx file:

<head runat="server">
<title></title>


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

</head>
<body>
<form id="form1" runat="server">
<div id="PageWrapper">
<div id="Header">Header Goes Here</div>
<div id="MenuWrapper">Menu Goes Here</div>
<div id="MainContent"></div>
<h1>
Hi there visitor and welcome to Planet Wrox</h1>
<p class="Introduction">
We're glad you're paying a visit to
<a href="http://www.PlanetWrox.com">www.PlanetWrox.com</a>, the coolest music
community on the internet.</p>
<p class="Introduction">
Feel free to have a <a href="Default.aspx">look around</a>; there are lots of interesting <strong>reviews
and concert pictures</strong> to be found here.</p>


<div id="Sidebar">Sidebar Goes Here</div>
<div id="Footer">Footer Goes Here</div>
</div>
</form>
</body>
</html>


Thanks for your help.
 
Old June 28th, 2015, 02:46 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Take a look at this:

<div id="MainContent"></div>

You're closing the MainContent div too early and thus none of the styles that use MainContent are applied to you content and links.

Move the div down to just before the SideBar and it should wok.

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!
 
Old June 29th, 2015, 12:27 PM
Registered User
 
Join Date: Jun 2015
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thats fixed it! And it fixed another problem with the sidebar. Thanks a lot Imar.





Similar Threads
Thread Thread Starter Forum Replies Last Post
p91, Dialogs errors. celviano BOOK: Android Application Development Cookbook: 93 Recipes for Building Winning Apps 0 July 20th, 2013 03:28 AM
Css formatting problem beetle_jaipur CSS Cascading Style Sheets 2 June 5th, 2009 07:16 AM
CSS problem stuartlittle ASP.NET 2.0 Professional 1 March 11th, 2008 02:28 PM
CSS comments problem Groundhog1248 CSS Cascading Style Sheets 2 January 20th, 2005 09:23 AM
CSS Problem Ben Horne HTML Code Clinic 2 November 10th, 2003 05:31 PM





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