37 users online (1 members and 36 guests)  


  Results 1 to 6 of 6

Related

  1. Cascading Style Sheets - CSS Generator    Forum: CSS Forum
    Replies: 1
  2. Javascript function that changes style    Forum: Javascript Forum
    Replies: 0
  3. spread sheets    Forum: HTML Forum
    Replies: 4
  4. style sheets    Forum: HTML Forum
    Replies: 2
  1. #1
    Gummy's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Canada
    Posts
    9

    Talking style sheets with the pre tag

    Hi,

    How can I use stylesheets to limit the size of the text area yet still use the pre tag to keep the whitespaces?

    i.e. say I want my text on the page to be left aligned in a 300 pixel area with an offset from the top of 15 and an offset from the left of 15, plus I want to keep all the white space formatting within the 300 pixel area.

    sample format:

    Topic 1:

    For topic1, I want the title as is with the space in between but I want the text I am writing now in an retangle of area 300 pixel that will wrap.

    Topic 2:

    Again, all formatting should be maintained for the topic titles with the spacing "as is" and the current line of text continuing and wrapping with in the 300 pixel area. Is there a way to do this?


    Thanks!

    Gummy P.s: yeah I agree, nice new look you have here!

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662

    Post

    I'm not sure I understand what u want, so I may be telling you stuff you already know.

    To define the text box, u use position with width and height, and set the overflow to visible, scroll, or hidden.This will limit the text to where it can go, and then I assume all you do is add another rule for your white-space. Example:

    P { position: absolute; width: 300px;
    height: 300px; overflow: visible; }

    P { white-space: pre }

    I THINK this is what you want to acheive. Or am I barking up the wrong tree? Probably am. I'm crap at trees.

    ------------------
    QuietDean-

  3. #3
    Gummy's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Canada
    Posts
    9

    Smile

    Thanks, but I don't think that's what I want.

    What I want to do is to keep the formatting the user enters in a text box (kind of like what I'm doing right here in the belletin board when I submit a question or reply).

    If for example, when I type a carraige return after a paragraph or when I use spaces to indent my paragraphs, I want the formatting maintained when I submit the form and when it is redisplayed on another page.

    I hope that helps make it more clearer as to what I hope to do.

    Gummy

  4. #4
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662

    Post

    Ahhhh! Sorry, I completely missed what you were trying to achieve. Known for it, I am.

    The only attribute I know that sounds vaguely like it could do what you want is wrap. This forces the user input in a text area to wrap, and is used
    <text area wrap=physical>

    As far as I know, the contents of a textarea are sent to the cgi as-is. I think this is the default.

    ------------------
    QuietDean-

  5. #5
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662

    Post

    Woops hit return by mistake.

    Is this for an email form? 'Cos if your fields are coming out 'all in straight lines' as it were, this is probably the fault of your email thing-amy.

    I'm pretty sure that textarea sends the information in the format it is submitted in.Unless you set wrap=soft.

    Sorry if this don't help! (Again...)


    ------------------
    QuietDean-

  6. #6
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel

    Post

    Gummy, Has your problem been solved??



Tags for this Thread