Jump to content

Scrollable Text Area In Dreamweaver


David

Recommended Posts

Ive always been a little confused about how to get a scrollable text area on a layout. I dont want to use an I-frame, I just want the text to overlay the background and be scrollable. Is this possible?? Im pretty sure you cant use a scroll bar in a table.

Not too sure how clear that was?

Thanks,

Dave

Link to comment
Share on other sites

You can do it by giving the area a fixed height and width then using id or class refer it to a style with

overflow: scroll;

e.g.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Meh</title>

<style type="text/css">
#box {
    width: 400px;
    height: 200px;
    overflow: scroll;
}
</style>
</head>

<body>

<div id="box">
La la la la la
</div>

</body>
</html>
[/code]

Link to comment
Share on other sites

Make a div

<div>
Content
</div>
Give it an id or class. Use id if you are only going to use it once, or a class if you are going to use it many times.
<div class="scrollable">
Content
</div>
Then do the CSS, either inline or externally.
.scrollable {
  width:400px;
  height:400px;
  overflow:auto;
}

The "overflow:auto;" is the important bit, it makes a scrollbar appear if the content of the div is higher then 400 or wider then 400.

Also try "overflow:scroll;" if auto doesn't produce the desired output.

And Danny is also gay. :(

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...