Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox displays horizontal scrollbars on <pre> element #13917

Closed
wolfy1339 opened this issue Jun 24, 2014 · 22 comments
Closed

Firefox displays horizontal scrollbars on <pre> element #13917

wolfy1339 opened this issue Jun 24, 2014 · 22 comments

Comments

@wolfy1339
Copy link
Contributor

I made a page, but for some reason Firefox seems to be displaying a horizontal scroll bar on the <pre> element.
The only workaround i have found is to add the <code> element tag along with the <pre> element tag
Version of Firefox: 30.0
OS:Windows, Ubuntu 12.04.4
http://vps3.wolfy1339.tk/FuslVZ/noFix.html

Screenshot
http://www.picpaste.de/pics/fuslfaq.1403639917.jpg

@cvrebert cvrebert added the css label Jun 24, 2014
@cvrebert
Copy link
Collaborator

@wolfy1339 Looks like your screenshot failed to upload.
What version of Firefox? What OS?

@cvrebert cvrebert added this to the v3.2.1 milestone Jun 24, 2014
@cvrebert
Copy link
Collaborator

<meta viewport="width=device-width, initial-scale=1.0"/>

No, that's not the right syntax for that. It's supposed to be:

<meta name="viewport" content="width=device-width, initial-scale=1.0"/>

@wolfy1339
Copy link
Contributor Author

@cvrebert fixed viewport, added the OS's and version

@cvrebert
Copy link
Collaborator

I can't reproduce on Windows or Linux. Could you re-upload your screenshot?

@wolfy1339
Copy link
Contributor Author

@cvrebert reuploaded, i'll make a new version without the workaround applied,
here's the link: http://vps3.wolfy1339.tk/FuslVZ/noFix.html

@cvrebert
Copy link
Collaborator

Okay, now confirmed on Windows & OS X Firefox.
IE11 & Chrome & Safari 7 do not show any scrollbar.

@cvrebert cvrebert changed the title firefox, displays scrollbars on pre element Firefox displays horizontal scrollbars on <pre> element Jun 24, 2014
@hnrch02
Copy link
Collaborator

hnrch02 commented Jun 24, 2014

Applying white-space: pre-wrap; to the pre element fixes this. (That's what makes your previous fix work.)

@cvrebert
Copy link
Collaborator

But both Chrome and Firefox report that the <pre> has a computed style of white-space: pre, so why are the renderings differing in the first place?

@hnrch02
Copy link
Collaborator

hnrch02 commented Jun 24, 2014

Reading this MDN document and the spec it seems as if Firefox is behaving correctly while Chrome is implementing pre wrong.

@cvrebert
Copy link
Collaborator

Disabling the word-wrap: break-word style seems to make Chrome behave like Firefox.

Seems to fall under these WebKit/Chrome bugs:

Don't know what, if anything, we should do about this.

@hnrch02
Copy link
Collaborator

hnrch02 commented Jun 24, 2014

/cc @mdo

@mdo
Copy link
Member

mdo commented Jul 6, 2014

Punting because bugs I suppose. (Reopen if I'm wrong or if someone is more interested in derping around on this one.)

@mdo mdo closed this as completed Jul 6, 2014
@mdo mdo removed this from the v3.2.1 milestone Jul 6, 2014
@cvrebert
Copy link
Collaborator

cvrebert commented Jul 6, 2014

@mdo If my understanding is correct, there's no reason for us to be setting word-wrap & word-break on <pre>, because <pre> has a default white-space: pre style (which we don't override).

@mdo
Copy link
Member

mdo commented Jul 6, 2014

@cvrebert Yeah, I probably added it for the docs awhile back. http://jsbin.com/nayaw/1/ looks fine without both properties.

@mdo
Copy link
Member

mdo commented Jul 6, 2014

Thoughts on removing those pre-v4?

@cvrebert
Copy link
Collaborator

cvrebert commented Jul 6, 2014

It would be a behavior change in Chrome & Safari, but on the other hand, per this issue, the behavior was already inconsistent across browsers..

@mdo
Copy link
Member

mdo commented Jul 6, 2014

Yeah, I'll punt to after v4. It's one of those things that isn't really the buggiest of bugs.

@cvrebert
Copy link
Collaborator

cvrebert commented Jul 6, 2014

@mdo Cool, add an entry in the Gist then.

@mdo
Copy link
Member

mdo commented Jul 6, 2014

Did right after I commented 😁.

@hnrch02
Copy link
Collaborator

hnrch02 commented Jul 6, 2014

Time to go hutin' for that secret v4 gist 😆

@caylorme
Copy link

caylorme commented Dec 3, 2014

I'm experiencing the same thing in a inside of a form-group div.
no amount of word-wrap: break-word will fix this.

@cvrebert
Copy link
Collaborator

cvrebert commented Dec 3, 2014

@caylorme That's off-topic for this issue, which is about <pre>s.

@twbs twbs locked and limited conversation to collaborators Dec 3, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants