Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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...

share|improve this question

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 }
share|improve this answer
    
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 Aug 6 '10 at 12:43
1  
That is just the way CSS works. It is weird that the inline style is used at all. –  Nick Hadlee Aug 6 '10 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 Jun 7 '11 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.

-V

share|improve this answer
    
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 Aug 6 '10 at 12:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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