Does anyone else have this problem and know of a work around?

On a WebPart page, add a Search Box WebPart. Edit the properties of the WebPart and change the Query text box width (in pixels) option. I tried setting mine to 50, 300 and 500 and none of these values seem to change the way the text box looks on the page.

It seems the Search Box WebPart doesn't honor the value set in the TextBoxWidth attribute. Sometimes I feel like I'm a beta tester on a released product...

2 Answers 2


In 2007 there was a CSS style that could be overwritten for the input element. I just had a look and there is a CSS rule for the search input:

.s4-search INPUT.ms-sbplain { width: 194px !important }

I think you need to override this CSS rule to get the effect you want. Your CSS will have to be the last thing that is applied and you need the !important too. Maybe try a more 'direct' rule to override the core stuff e.g.:

#SRSB INPUT.ms-sbplain { width: XXXpx !important }
  • I see where the input box is referencing the ms-sbplain style. It seems that the UI adds style="width:300px;" but because the CSS style has the !important flag it overrides the width that is set through the UI. Sounds like a bug to me.
    – Corbett
    Commented Aug 6, 2010 at 12:43
  • 1
    That is just the way CSS works. It is weird that the inline style is used at all. Commented Aug 6, 2010 at 22:37
  • inline styles crop up now and again, I think it comes down to the person developing that particular functionality at that time. !important is a standard way of overriding an inline style, not a bug.
    – James Love
    Commented Jun 7, 2011 at 8:24

Have you trying to mofidy the width of the webpart itself, instead of the text box? The option is under "appearance."

Usually I can set width to be fixed (in general) through the UI like that.


  • The webpart's width is set to 400 pixels and the text box width is set to 300. As I change the width of the webpart the text box stays the same width.
    – Corbett
    Commented Aug 6, 2010 at 12:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.