1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

using CSS to indent

Discussion in 'CSS' started by genevieve, Aug 9, 2005.

  1. #1
    I have been trying to indent "wrapped" text, so that I can pull in a list from a database and have the wrapped line indent, like this:

    List Item Number One
    List Item Number Two
    List Item Number

    Three
    List Item Number Four

    ...etc.

    I found a tip that said to try to indent the first line less than the others, so sort-of "backward indenting." I tried it, but the first-line command doesn't seem to do anything for me. Any ideas on how to fix this, or another way to make it indent? Here is an example (in quotes because I can't use live links yet):
    "http://www.butlertech.org/glc/indent2.asp"
    it uses the style sheet test3.css​
     
    genevieve, Aug 9, 2005 IP
  2. Arnica

    Arnica Peon

    Messages:
    320
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi genevieve

    According to the CSS specification UAs do not have to support the margin property for the :first-line pseudo-element:
    The margin property does apply to the :first-letter pseudo-element so you can use it to 'outdent' your first line. As you state you want to populate a list from a database I would suggest that a 'list' element would be best suited. The following would work as intended.
    CSS
    ul {
     padding-left:30px;
     list-style-type:none;
    }
    li:first-letter { 
     margin-left:-20px;
    }
    li a:first-letter { 
     margin-left:-20px;
    } 
    HTML
       <ul ><li>:: ALL PROGRAMS ::</li>
            <li>  <a href="ag_ed.asp">Agricultural Education</a></li>
            <li>  <a href="auto_collision.asp">auto collision technology</a></li>
            <li>  <a href="auto_tech.asp">auto technology</a></li>
            <li>  <a href="biotech.asp">Biotechnology</a></li>
     
        </ul>
    
    Code (markup):
     
    Arnica, Aug 9, 2005 IP
  3. genevieve

    genevieve Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    That works great! Thanks for your help! :D
     
    genevieve, Aug 10, 2005 IP