搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

CSS: change width of searcher popup

  • 5 回覆
  • 1 有這個問題
  • 34 次檢視
  • 最近回覆由 Yaron

more options

In FF 69 RTL the searcher popup is 1px shorter (on the left) than the searcher itself.

Can this be fixed with CSS?


Thank you.

In FF 69 RTL the searcher popup is 1px shorter (on the left) than the searcher itself. Can this be fixed with CSS? Thank you.
附加的畫面擷圖

所有回覆 (5)

more options

Hi Yaron, if I look at it with the window maximized, which is the usual situation for me, it seems fine:

The outer box around the magnifying glass, text box, and arrow, which is under

toolbar#nav-bar > hbox#nav-bar-customization-target > toolbaritem#search-container > searchbar#searchbar

has a reported width of 249.6 pixels while the drop-down under

popupset#mainPopupSet > panel#PopupSearchAutoComplete

has a reported width of 249.4 pixels. With subpixel aliasing, any difference is too slight for me to discern.

However, if I switch the window to resizable, there is a visible discrepancy: 151.2px vs. 150px.

(That's on the Layout tab of the Inspector in the Browser Toolbox.)

I don't know how these peculiar widths are determined, but if you are going to override one, you probably should set both to keep them in sync when the window width changes.

more options

You can consider to move the search bar to the overflow area to see whether that gives more width.

That gives me a search bar of about 400px width, even width a small window width.

more options

Hello jscher2000 and cor-el,

Thank you for replying. I appreciate it.

Using an image-editor, the actual difference is 1px.

With

  1. PopupSearchAutoComplete { min-width: 305px !important; }

I get the same width for the searchbar and its popup in a maximized window.

Obviously this isn't the best solution. Any other idea?

---

@cor-el,

The problem is in FF 69 *RTL*. The searcher popup is 1px shorter (on the left) than the searcher itself.

more options

Yaron said

With
#PopupSearchAutoComplete { min-width: 305px !important; }
I get the same width for the searchbar and its popup in a maximized window. Obviously this isn't the best solution.

But maybe it's the best available at this time?

The drop-down lives in a completely separate part of the document from the toolbar, so unlike normal HTML layouts where you could use something like

width:100%

to match the width of a parent element, you have no choice but to handle the width using absolute measurements.

more options

Well, you're the expert. :)

Thanks for the detailed explanation.