Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] Text with width limitation and wrappable

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #160786
    nemadeka
    Participant

    I am a teacher with basic knowledge of VBA and HTML, English isn’t my native language, so please, bear with me.

    I am designing a page template. I need to limit the width of the text to, say 600 pixels, to avoid extremely long lines which are hard to read. However, if the user’s browser’s window is narrower than the 600 px, I need to get the text wrapped. I use .TextMain { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; width: 600px; } and if I resize the browser window so that it’s horizontally narrower than 600 pixels, no wraping occurs, the text in the right side goes beyond the window and cannot be read. I don’t want to use tables.

    Please, provide a tip or at least search keywords, because my googling gets me nowhere.

    Thank you AO

    #160787
    Gary Pickles
    Participant

    Hi nemadeka you could replace width:600px; with max-width:600px;

    #160788
    nemadeka
    Participant

    Exactly what I need.
    Thanks, this solved my problem.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.