SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    May 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Indenting Overflow Text

    Is there a way to indent overflow text? For example, say I have the following:

    Code:
    <p style="width: 50px;height: 300px">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sollicitudin tellus id ligula eleifend pharetra. Etiam malesuada tincidunt mattis. Maecenas ac odio ut nisl lacinia tempor. Nam congue consectetur scelerisque. Integer nec orci ut felis consectetur mattis. Nullam faucibus erat a augue hendrerit eleifend. Aenean varius ultricies massa, vitae ullamcorper libero semper eu. Fusce aliquam blandit tortor, ac ultrices leo sollicitudin in. In ullamcorper leo vel nibh interdum gravida. Mauris consectetur, lacus vel ornare elementum, metus lorem vehicula arcu, sit amet sollicitudin magna neque id velit. Nam et lacinia leo. Mauris elementum nisl ante. Suspendisse scelerisque pretium euismod. Sed id nulla vitae mauris mollis mattis at rhoncus nisi.
    </p>
    Obviously, there will be overflow. Is there a way to make the overflow lines indent, maybe 15 pixels, to the right of the first line?

  2. #2
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,565
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    If you want the indenting to start once the width/height is achieved (dynamic situations here) then no it's not possible.

    You could indent the first line (or every line but the first) but making text indent with overflowed lines for dynamic environments (which is what I think your posting) isn't feasible with CSS

    Though I'm wondering why you would want this done anyway so I'm probably misunderstanding something anyway
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  3. #3
    Resident curmudgeon bronze trophy gary.turner's Avatar
    Join Date
    Jan 2009
    Location
    Dallas
    Posts
    990
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why would you paint yourself into that corner anyway? Do you have some compelling reason that I can't imagine? Remove the height property, and let the container expand or contract vertically as needed.

    cheers,

    gary
    Anyone can build a usable website. It takes a graphic
    designer to make it slow, confusing, and painful to use.

    Simple minded html & css demos and tutorials

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,343
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    As the others have said I'd be interested to know the reasoning behind this which might help in understanding the problem and providing a solution.

    Visible overflow is just - visible overflow. You can't do anything with it except hide it or make it scroll. It can't be addressed on its own.


Tags for this Thread

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
  •