SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Location
    CA, USA
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Scroll inside a web page

    I am attempting to add content with a scroll. I thought maybe I should make it a text box and remove the borders. I am seeing now this is not the way to go (being that the box is for input not content).

    How would I achieve this: content that can scroll. I want two rows, 80 cols and the ability for the visitor to scroll the content.

    Thanks.
    Wannabe Brainiac

  2. #2
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Basically you want to make a DIV scrollable and the simplest way is to give it dimensions and set the overflow. For example:

    <div style="width: 8em; height: 2em; background-color: #ff0000; overflow: auto;">Det finns ingen som &#228;lskar sm&#228;rta, som s&#246;ker det och vill ha det, just f&#246;r att det &#228;r sm&#228;rta...</div>

    You could also have set overflow value to 'scroll' instead of 'auto', which is probably what you wanted.

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Location
    CA, USA
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    I'm not Swedish but thanks I got it...
    Wannabe Brainiac

  4. #4
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Location
    CA, USA
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not getting how to manipulate this with CSS
    Wannabe Brainiac

  5. #5
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Location
    CA, USA
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Word_bird View Post
    Not getting how to manipulate this with CSS
    specifically how to move the box around the page...
    Wannabe Brainiac

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,112
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by Word_bird View Post
    specifically how to move the box around the page...
    The best way is with floats, but you can use relative/absolute positioning (though it's usually not the best way).

    We'd need to see your page to be able to advise on how to write the CSS.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  7. #7
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Location
    CA, USA
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll try the float too but I just wrapped it in another div...Thanks
    Wannabe Brainiac

  8. #8
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,112
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by Word_bird View Post
    I just wrapped it in another div
    Of itself, this will do nothing.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  9. #9
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Location
    CA, USA
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    works for me...don't know if it's 'wrong' or 'right'...but...
    what is the 'correct' method for positioning the scroll div...
    Wannabe Brainiac

  10. #10
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,112
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by Word_bird View Post
    what is the 'correct' method for positioning the scroll div...
    That's like asking "where should I place my sofa?" To answer that, we'd need to know the layout of your room, what other furniture it contains, and what your need are.

    Generally floating is the best method, but to detail how to do it we'd have to see your page.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  11. #11
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Location
    CA, USA
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    That's like asking "where should I place my sofa?"
    I was not asking where to place it...I was asking for the 'device' (code) etc IN ORDER TO move it so I can place it where I want...
    Wannabe Brainiac

  12. #12
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,112
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by Word_bird View Post
    I was not asking where to place it...I was asking for the 'device' (code) etc IN ORDER TO move it so I can place it where I want...
    I know, but I mentioned earlier that you could use floats or relative/absolute positioning. That's a very general answer, though, and can't really be improved upon without knowing the circumstances of the div you want to position.

    You said you had already floated it, so obviously this tip is not enough of a guide. Thus, I was trying to prompt you to give more information so that a more useful answer could be offered.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  13. #13
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Location
    CA, USA
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks
    Wannabe Brainiac

  14. #14
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    I'm not Swedish either but I wanted some "dummy text" to fill the DIV (to show the effect).

    Off Topic:

    A certain tall guy with a big-beard and cat perched on his shoulder will be amused by that.


    Thankee


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
  •