Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6746929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:22:50+00:00 2026-05-26T12:22:50+00:00

How can I wrap the text displayed in the browser to either the width

  • 0

How can I wrap the text displayed in the browser to either the width of the browser or a specified width, whichever is less?

I have been putting text inside <table width='850'> to wrap at a specific point, so if the user maximizes their browser on a gigantic monitor a whole paragraph doesn’t fit in a single line. But when the user makes the browser super narrow, the above method causes text to carry over the edge of the viewable area. Not what I want exactly.

So, I’m looking for a better approach.

Oh, maybe I should add that my pages are extremely simple. There aren’t banners up and down the left or right sides of them. Just text and images occupy the space from the left border of the browser to the right. Boring stuff.

EDIT – I accepted an answer, but I did find an issue (and a solution that seems to work) with the accepted answer when used with Internet Explorer. I spent half an hour trying to get max-width to work, but just couldn’t. Every other style property worked fine though. Then I discovered this http://svendtofte.com/code/max_width_in_ie which said I had to use the following for max-width to work in IE, and it did: p { width:expression(400 + “px”); }. I don’t understand why the fiddle example worked with max-width on IE, but not my page. Maybe it’s cuz I include my css in my html page?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:22:51+00:00Added an answer on May 26, 2026 at 12:22 pm

    You could set the max-width property in your css.

    That way, the page will expand until a certain point and then no more.

    Example:

    .mainDiv{
        max-width:700px;
    }
    

    Working example: http://jsfiddle.net/Pa5JG/

    More info on max-width: http://reference.sitepoint.com/css/max-width

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The pre tags in IE 7 do wrap the text but the table width
How can I make my text wrap automatically to the next line when I
I can't seem to wrap my head around how img tags behave alongside text
I would like to have a function that can wrap any other function call.
If I have a character (say +) inside text and I would like to
I have been trying to work out the bug on this but can't seem
I have a requirement to allow selecting the text displayed in read only screens.
I have one line of text that is too long to be displayed in
I have some text that needs to be displayed in my app. The text
How can I write a wrapper that can wrap any function and can be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.