Text not obeying width given.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jacksoncn
    New Member
    • Jul 2007
    • 14

    Text not obeying width given.

    Hey, I don't know what going on here...but the text in this div is running outside of the width I've given the div. Can someone PLEASE help me.

    Here's the css:


    .content_box_1{
    background-repeat:repeat-y;
    background-image:url(../images/box_1.jpg);
    width:198px;
    }

    Here's the html:

    <td class="content_ box_1">
    dshfjksdhfkjdfh kjshfkjsfhkjshf kjshjkldsjflksj flksjflkdsjflks d
    </td>
  • epots9
    Recognized Expert Top Contributor
    • May 2007
    • 1352

    #2
    Originally posted by jacksoncn
    Hey, I don't know what going on here...but the text in this div is running outside of the width I've given the div. Can someone PLEASE help me.

    Here's the css:


    .content_box_1{
    background-repeat:repeat-y;
    background-image:url(../images/box_1.jpg);
    width:198px;
    }

    Here's the html:

    <td class="content_ box_1">
    dshfjksdhfkjdfh kjshfkjsfhkjshf kjshjkldsjflksj flksjflkdsjflks d
    </td>
    try breaking the word
    [code=css]
    content_box_1{
    background-repeat:repeat-y;
    background-image:url(../images/box_1.jpg);
    width:198px;
    word-wrap: break-word;
    }
    [/code]

    Comment

    • drhowarddrfine
      Recognized Expert Expert
      • Sep 2006
      • 7434

      #3
      You are trying to set the width of the cell but cell width is controlled by the width of the table and other cells.

      Comment

      • jacksoncn
        New Member
        • Jul 2007
        • 14

        #4
        Originally posted by epots9
        try breaking the word
        [code=css]
        content_box_1{
        background-repeat:repeat-y;
        background-image:url(../images/box_1.jpg);
        width:198px;
        word-wrap: break-word;
        }
        [/code]

        that didn't work.any other ideas? i'd appreciate it.

        Comment

        • jacksoncn
          New Member
          • Jul 2007
          • 14

          #5
          alright, i made the class independant from the td. still no go.

          <td>
          <div class="content_ box_1">
          dshfjksdhfkjdfh kjshfkjsfhkjshf kjshjkldsjflksj flksjflkdsjflks d
          </div>
          </td>

          any other ideas?

          Comment

          • drhowarddrfine
            Recognized Expert Expert
            • Sep 2006
            • 7434

            #6
            The problem now is you don't give the browser anywhere to have the break. There are no spaces in that line. Well, there is one, but you have to add your <br> also.

            Comment

            • jacksoncn
              New Member
              • Jul 2007
              • 14

              #7
              Originally posted by drhowarddrfine
              The problem now is you don't give the browser anywhere to have the break. There are no spaces in that line. Well, there is one, but you have to add your <br> also.
              F' in A. thanks so much!!!!

              Comment

              Working...