8 Replies - 1892 Views - Last Post: 30 March 2012 - 12:19 AM

#1 Crowz  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 68
  • Joined: 09-February 12

Easy question. How to make a scrollable text box?

Posted 24 March 2012 - 07:42 PM

So say I have a background box. The background box is

left:10%;
top:5%;
right:10%;
height:90%;
width:80%;


Then there is a banner that's 200 pixels tall and the same width across the top.

Right now, there isn't a menu, but it will be approx 10%-20% of the size of the main box, on the left edge.

And I want, finally, a text box, taking up the rest of the space. But how do I make it so it scrolls through text? Like, so no matter how much text, it only takes up that amount of space.

Is This A Good Question/Topic? 0
  • +

Replies To: Easy question. How to make a scrollable text box?

#2 Atli  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 3719
  • View blog
  • Posts: 5,990
  • Joined: 08-June 10

Re: Easy question. How to make a scrollable text box?

Posted 24 March 2012 - 07:58 PM

Are we talking about a <textarea>? Those automatically scroll when the text you put into them exceed their size.

If you're talking about a normal block element, like a <div> or a <p>, with a set size, then you can set overflow: auto; on it and it will automatically add scroll bars when needed, or you can just do overflow: scroll; to permanently place scroll bars on it.
Was This Post Helpful? 1
  • +
  • -

#3 Crowz  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 68
  • Joined: 09-February 12

Re: Easy question. How to make a scrollable text box?

Posted 24 March 2012 - 08:33 PM

This is probably painfully stupid to ask... but how does one make a text box? I only have a <div> with the ID "textbox"
Was This Post Helpful? 0
  • +
  • -

#4 Atli  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 3719
  • View blog
  • Posts: 5,990
  • Joined: 08-June 10

Re: Easy question. How to make a scrollable text box?

Posted 24 March 2012 - 09:01 PM

What do you mean by "text box"? Something people can write into (like what you use to write here) or just something to display text?

If it's the former, then you can use the <textarea> element. If it's the latter, then you can use pretty much any element you want. <div> and <p> elements are the popular choices though.
Was This Post Helpful? 1
  • +
  • -

#5 Crowz  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 68
  • Joined: 09-February 12

Re: Easy question. How to make a scrollable text box?

Posted 24 March 2012 - 09:25 PM

View PostAtli, on 24 March 2012 - 09:01 PM, said:

What do you mean by "text box"? Something people can write into (like what you use to write here) or just something to display text?

If it's the former, then you can use the <textarea> element. If it's the latter, then you can use pretty much any element you want. <div> and <p> elements are the popular choices though.


I just found this "iframe" thing, actually...
But is there a way to remove the scroll bar in lou of something more aesthetic?
Like, for example, the iPhone has that little thing that shows up only when you scroll.
Maybe that's closer to jquery domain.
Was This Post Helpful? 0
  • +
  • -

#6 e_i_pi  Icon User is offline

  • = -1
  • member icon

Reputation: 795
  • View blog
  • Posts: 1,681
  • Joined: 30-January 09

Re: Easy question. How to make a scrollable text box?

Posted 29 March 2012 - 03:06 PM

That's definitely jQuery domain. And I won't say "don't use iFrames", but I will say there are other options that involve CSS and jQuery.
Was This Post Helpful? 0
  • +
  • -

#7 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 584
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: Easy question. How to make a scrollable text box?

Posted 29 March 2012 - 03:09 PM

View PostCrowz, on 25 March 2012 - 01:33 PM, said:

This is probably painfully stupid to ask... but how does one make a text box? I only have a <div> with the ID "textbox"

Either:
<input type="textbox">

Or:
<textarea></textarea>


EDIT: whoops!

This post has been edited by DimitriV: 29 March 2012 - 03:17 PM

Was This Post Helpful? 0
  • +
  • -

#8 Atli  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 3719
  • View blog
  • Posts: 5,990
  • Joined: 08-June 10

Re: Easy question. How to make a scrollable text box?

Posted 29 March 2012 - 03:15 PM

@DimitriV. The input element has no "textarea" type. You're confusing it with the <textarea> tag.
Was This Post Helpful? 0
  • +
  • -

#9 sas1ni69  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 85
  • View blog
  • Posts: 431
  • Joined: 04-December 08

Re: Easy question. How to make a scrollable text box?

Posted 30 March 2012 - 12:19 AM

Why don't you take a look at a simple HTML tutorial. It would actually help you especially on basic things like a text box and a text area. Tizag is a good place to start. Good luck :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1