Wrox Programmer Forums
|
BOOK: Beginning HTML and CSS (published March 2013)
This is the forum to discuss the Wrox book Beginning HTML and CSS by Rob Larsen; ISBN: 978-1-1183-4018-9
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning HTML and CSS (published March 2013) 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 September 25th, 2013, 01:22 AM
Registered User
 
Join Date: Sep 2013
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Talking Styling Text on Chapter 7

This:

#navigation a {
color: #3399cc;
text-decoration: none;
}

doesn't seem to be working at all. It doesn't seem to get selected. The links are still underlined as usual.
 
Old September 25th, 2013, 08:11 AM
Wrox Author
 
Join Date: Apr 2012
Posts: 19
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Can you show me the HTML you're trying to apply it to?
 
Old September 25th, 2013, 09:16 AM
Registered User
 
Join Date: Sep 2013
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Talking

<nav id="navigation">
HOME
<a href="menu.html">MENU</a>
<a href="recipes.html">RECIPES</a>
<a href="opening.html">OPENING</a>
<a href="contact.html">CONTACT</a>
</nav>
 
Old September 25th, 2013, 09:20 AM
Wrox Author
 
Join Date: Apr 2012
Posts: 19
Thanks: 0
Thanked 3 Times in 3 Posts
Default

That should work. Unless the style sheet isn't attached to the document, that's all you would need. There is an example of that code working in the code downloads, so you can compare what you've done to that.
 
Old September 25th, 2013, 09:49 AM
Registered User
 
Join Date: Sep 2013
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Nope, doesn't work. I even copied the html and css code over from your sample_application_one and inserted it into my code. It works in your code but not mine for some reason.

I copied the html and css code snippets to a new html file and it works.

Last edited by thuyhoang; September 25th, 2013 at 10:01 AM..
 
Old September 25th, 2013, 10:03 AM
Wrox Author
 
Join Date: Apr 2012
Posts: 19
Thanks: 0
Thanked 3 Times in 3 Posts
Default

If it works in the example code and not in your version, it's not an issue with your browser or with the technical aspects of the code. You've got a bug somewhere in your implementation. A big part of programming is finding out where the bugs are. The good news for you is that you can compare a working example with one that isn't working.

What browser are you using to test?
 
Old September 25th, 2013, 10:12 AM
Registered User
 
Join Date: Sep 2013
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm using Chrome.
 
Old September 25th, 2013, 10:21 AM
Wrox Author
 
Join Date: Apr 2012
Posts: 19
Thanks: 0
Thanked 3 Times in 3 Posts
Default

So if you hit F12 and then right click on the menu you're trying to style, you can click "inspect element" which will open the developer tools with that element selected. It will tell you, in the right hand pane, where it's styles are being inherited from.

You can also look at the the Network tab to see if the style sheet is being properly loaded. There's a lot there that can help you figure out what's wrong with your implementation.
 
Old September 25th, 2013, 05:08 PM
Registered User
 
Join Date: Sep 2013
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The only difference I see using F12 is that there are quotes around the HOME word. Like this:


Code:
   <nav id="navigation">
    	" HOME "
        <a href="menu.html">MENU</a>
        <a href="recipes.html">RECIPES</a>
        <a href="opening.html">OPENING</a>
        <a href="contact.html">CONTACT</a>
    </nav>
Quote:
Originally Posted by roblarsen View Post
So if you hit F12 and then right click on the menu you're trying to style, you can click "inspect element" which will open the developer tools with that element selected. It will tell you, in the right hand pane, where it's styles are being inherited from.

You can also look at the the Network tab to see if the style sheet is being properly loaded. There's a lot there that can help you figure out what's wrong with your implementation.
 
Old September 25th, 2013, 08:35 PM
Wrox Author
 
Join Date: Apr 2012
Posts: 19
Thanks: 0
Thanked 3 Times in 3 Posts
Default

What does the rest of your HTML file look like?





Similar Threads
Thread Thread Starter Forum Replies Last Post
listview styling robbaralla BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 8 February 22nd, 2010 06:54 AM
C# Word Styling Automation rangeshram C# 2005 0 April 15th, 2009 01:51 AM
Styling the Menu Control stephenf BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 7 March 17th, 2009 02:41 PM
PHP Styling adaniels11 PHP How-To 1 April 10th, 2007 05:10 AM
XSLT and styling jacob XSLT 4 October 13th, 2005 02:50 AM





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