• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I get a span *inside* an anchor using CI anchor ?

Hi - I am trying to use a particular CSS technique and the tutorial requires that you place a span inside an <a> anchor - easy when using HTML, but not so obvious when using CI. Example:

   <li><a href="#">Buy Widgets <span></span></a></li>
   <li><a href="#">About Widget Corp <span></span></a></li>
   <li><a href="#">Contact Us <span></span></a></li>

when I attempt to do it with CI the span falls either outside the anchor or if you follow the user guide placing the span inside the CI anchor,like this

echo anchor("welcome/cat/$topkey", $toplist['name'],"<span></span>");

then the span shows up in front of the label and one of the chevrons shows up on the page.

I have tried various combinations of double and single quotes.

Many Many thanks for any advice !

Why are you putting it in the 3rd parameter (the attributes) of anchor()? Just append it to the 2nd parameter, which is the text of the link.
echo anchor("welcome/cat/$topkey", $toplist['name'] . '<span></span>');

Thanks CroxNix - the obvious defeats me again ! It worked great !

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.