• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 225
  • 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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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