Add Top of Page in List without indent?

  • inlineskater
  • Newbie
  • Newbie
  • inlineskater
  • Posts: 6

Post 3+ Months Ago

I have an <ol> list that goes from 1 to 10. At the end of each section of the list I need to add a top of page link. How do I do this to not have it indent with the list? :roll:
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1827
  • Loc: In the Great White North

Post 3+ Months Ago

set the <a> to display block and give it a negative left margin.
  • inlineskater
  • Newbie
  • Newbie
  • inlineskater
  • Posts: 6

Post 3+ Months Ago

Doing that for <a> will effect all <a> on site. I need to use a CSS - would an id work?
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1827
  • Loc: In the Great White North

Post 3+ Months Ago

you don't have to affect all of them. Probably the best bet is to give your ol a class and then go from there.

HTML
HTML Code: [ Select ]
<ol class="myList">
  <li>Some Text <a href="#">Link</a></li>
  <li>Some Text <a href="#">Link</a></li>
  <li>Some Text <a href="#">Link</a></li>
  <li>Some Text <a href="#">Link</a></li>
</ol>
 
  1. <ol class="myList">
  2.   <li>Some Text <a href="#">Link</a></li>
  3.   <li>Some Text <a href="#">Link</a></li>
  4.   <li>Some Text <a href="#">Link</a></li>
  5.   <li>Some Text <a href="#">Link</a></li>
  6. </ol>
  7.  


CSS that will only affect these
CSS Code: [ Select ]
ol.myList li a {display:block; left-margin:-20px;}
 
  1. ol.myList li a {display:block; left-margin:-20px;}
  2.  

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 27 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.