Forum Moderators: open

Message Too Old, No Replies

Help with my syntax please

class and links

         

Digmen1

2:25 am on Apr 22, 2009 (gmt 0)

10+ Year Member Top Contributors Of The Month



Hi Guys

As a self taught newbie I just a bit of help with the syntax of this line of code to make it work properly.

It is to show a link in different colors to my navigation links. So I have set up a css class of external.

But I just need a bit of help with the syntax of this html line.

<a class="external" a href="catalog.htm"> <p>Click here to view our product catalog and place your order.</p>

Kind Regards

Digby

tedster

3:38 am on Apr 22, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



An anchor element belongs nested within the paragrpah element, not the other way around. A paragaph is a block-level element, and an anchor is an inline element - inline elements should not contain block-level elements.

<a class="external"><p></p></a> << NO
<p><a class="external"></a></p> << YES

Make that switch and your style rules for the class should take effect on your anchor text.

DrDoc

10:45 am on Apr 22, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you want the whole paragraph clickable (which I assume is why you incorrectly wrapped the anchor tag around the paragraph tags), add
display: block
to your
external
class properties.

penders

11:51 pm on Apr 22, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



And...
<a class="external" a href="catalog.htm">...

should simply be:

<a class="external" href="catalog.htm">...

You have an extra 'a' floating around inside your anchor element.