• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 230
  • Last Modified:

how to make a DIV to follow browser's size?


Hello group,

I have a div where it contains 1 or more paragraphs however, when user re-sizes the browser, the width of the div (or the text) does not change with the width of browser and stays as it was.

How can I set in a way to follow browser's new width?

using CSS.

Thanks,
ak

This is the CSS code currently I have:
 
 <div class="scroll">
 and ....
 
 
.scroll
{
  height:490px;
  width:1352px;
 
  font:14px arial;
  line-height:20px;
  border:outset;
  overflow:auto; 
}

Open in new window

0
akohan
Asked:
akohan
  • 2
1 Solution
 
abelCommented:
> How can I set in a way to follow browser's new width?

set the width to a percentage, like this:



.scroll
{
  height:490px;
  width:100%;
 
  font:14px arial;
  line-height:20px;
  border:outset;
  overflow:auto; 
}

Open in new window

0
 
akohanAuthor Commented:

Thank you so much. I guess rather using px I have to stick to %.

Regards,
ak
0
 
abelCommented:
percentages can be life saver sometimes :)

glad to have been of some help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now