SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast AlbinoRhyno's Avatar
    Join Date
    Feb 2002
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can you indent line-wraps?

    Is there a way to indent the text which gets line-wrapped? For instance, say there is a 100px box, and the text is two words totaling 110px with a small (10px-ish) graphic in front of the first word.

    Can you set the wrap indent to line up the second word under the first word (12px or so in because of the graphic)?

    Thanks-

  2. #2
    SitePoint Evangelist azizur_rahman's Avatar
    Join Date
    Nov 2001
    Location
    London, UK
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why dont you use left-padding=10px or left-margin=10px ... check they both have different effect.

    it would be nice to see the actual page when talking about somehting visual, its hard to picture what you see.
    Azizur Rahman
    Web Application Developer

  3. #3
    SitePoint Enthusiast AlbinoRhyno's Avatar
    Join Date
    Feb 2002
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you go to my work-in-progress albinorhyno.com link in my signature, look at the left-hand nav. Margins would just shift everything over, not just the second line.

  4. #4
    pg for mild peril cow's Avatar
    Join Date
    Mar 2000
    Location
    nevada, usa
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i've done this in the past using tables...but i don't think there is a way using css.
    "There's no justice like angry mob justice!" --Seymour Skinner

  5. #5
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You wanted to do something like this? (Assuming that my server is turned on, you'll be able to view the example.)

  6. #6
    SitePoint Member
    Join Date
    Feb 2002
    Location
    Philadelphia
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about something like this...

    Place the image and link inside a block element like p or div, and assign it to class "indent2", defined in your stylesheet thus:

    .indent2 {
    margin-left: 12px;
    text-indent: -12px;
    }

    The negative value for text-indent should counteract the margin for the first line.

  7. #7
    SitePoint Member
    Join Date
    Feb 2002
    Location
    Philadelphia
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about something like this...

    Place the image and link inside a block element like p or div, and assign it to class "indent2", defined in your stylesheet thus:

    .indent2 {
    margin-left: 12px;
    text-indent: -12px;
    }

    The negative value for text-indent should counteract the margin for the first line.


Bookmarks

Posting Permissions

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