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 7503895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:23:13+00:00 2026-05-29T21:23:13+00:00

So I have a submit button with a specified width and the containing text

  • 0

So I have a submit button with a specified width and the containing text is pulled in from elsewhere, it’s dynamic. The problem is that in ie7, the text does not overflow properly and wrap onto a second line, it just runs off into oblivion!

Here is the html.

<input type="submit" value="<?php echo $dynamic_data ?>" class="custom-submit">

And the css.

.custom-submit {
    height: 76px;
    white-space: normal;
    width: 140px;
}

I have seen people suggest elsewhere to put line breaks into the button’s text but this will not work for me as the texts length is dynamic.

Any ideas?

  • 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-29T21:23:14+00:00Added an answer on May 29, 2026 at 9:23 pm

    I have a similar problem with buttons containing dynamic localized strings.

    The best solution would probably be not to use the <button> tag at all. You can replace it with <a> tags styled as buttons. IE seems to handle wrapping fine in that case.

    In my case, thats not an easy option. So I made a polyfill that patches the IE rendering:

    http://jsfiddle.net/dmitrytorba/dZyzr/247/

    var buttons = document.getElementsByTagName('button');
    for(var j=0; j < buttons.length; j++) {
        var button = buttons[j];
        var textNode = button;
        while(textNode.children[0]) {
            textNode = textNode.children[0];
        }
        var text, words, numSplits;
        var spacing = 0;
                while(button.scrollWidth !== 0 && button.clientWidth !== 0 &&
                      button.scrollWidth > button.clientWidth) {
            if(!spacing) {
                text = textNode.innerHTML;
                words = text.split(' ');
                numSplits = Math.ceil(button.scrollWidth / button.clientWidth);
                spacing = Math.round((words.length)/numSplits);
            }
            for(var i = spacing; i < words.length; i+=spacing+1) {
                words.splice(i , 0, '<br />');
            }          
            textNode.innerHTML = words.join(' ');
            spacing--;
            words = text.split(' ');
        }
    }    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a submit button that is a block of HTML code because of
I have a submit button that changes when the user hovers his mouse over
I have a search box that doesn't have a submit button, I need to
I have 2 text boxes and a submit button.On clicking on the submit button
Using the AngularJS framework, how do I have the Submit button both update the
I have one image submit button like this <input id=enter name=enter type=image value=Login src=images/btn_login.jpg/>
I have a question to the submit- button behavior of internet explorer. If I
I have a image button thats acts as a form submit button: <a href=#
I have a form with a submit button. I have called a function on
I have a form with a css submit button. When a the submit button

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.