Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Stagger Text in Links Bar

    I am new to css and admit I have a lot to learn.

    I have a column of links in a sidebar and what I would like to do is stagger each link (1st link indent 50 px, 2nd link indent 0 px, 3rd link indent 50 px, 4th link indent 0 px, ect)

    Is there a way to do this with css, I have tried a few things but my text formatting keeps changing. Below is the css code I have applying to my sidebar.

    Thanks for any help you can offer to this newbie.


    #sidebar ul {
    list-style-type: none;
    width: 100%;
    display: block;
    margin: 0;
    padding: 0;
    }
    #sidebar li {
    display: block;
    }
    #sidebar a {
    font-size: 1.3em;
    font-weight: bold;
    text-decoration: none;
    color: #00f;
    display: block;
    text-indent: -0px;
    padding: 15px;
    padding-left:5px
    }
    #sidebar a:hover {
    font-size: 1.5em;
    text-decoration: none;
    color: #f00;
    }

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    CSS
    Code:
    a.indent
    {
    margin-left:50px;
    }
    HTML
    Code:
    <a class="indent">first indented link</a>
    <a>first normal link</a>
    <a class="indent">second indented link</a>
    <a>first normal link</a>
    and so on..

    Also, are you aware that you can only apply an ID to one element in an HTML doc?

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #3
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for your help, that did the trick.

  • #4
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    No Problem!

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •