Bug 14429 - floating div after center alignment causes premature linebreak in text
Summary: floating div after center alignment causes premature linebreak in text
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 523.x (Safari 3)
Hardware: All OS X 10.4
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2007-06-27 06:47 PDT by Liam Breck
Modified: 2022-06-16 20:37 PDT (History)
8 users (show)

See Also:

SAR (834.86 KB, image/png)
2022-06-16 16:53 PDT, Ahmad Saleem
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Liam Breck 2007-06-27 06:47:47 PDT
Observe the premature linebreak after "three" in this example.

<html><body style=”width:200”>

<div style="text-align:center">centered section</div><br/>

One two three <div style="background:#ccc; float:right;">div<br/>float</div>four five six seven eight nine ten eleven twelve thirteen fourteen fifteen sixteen.

Comment 1 mitz 2007-06-27 14:08:16 PDT
Behavior is the same without text-align:center.
Comment 2 Liam Breck 2007-06-27 22:50:31 PDT
(In reply to comment #1)
> Behavior is the same without text-align:center.

On 522.11, commenting out the centered line yields the correct layout.

Workaround is to use <div style="text-align:left"> immediately after centered div
Comment 3 Ahmad Saleem 2022-06-16 16:53:08 PDT
Created attachment 460285 [details]
Comment 4 Ahmad Saleem 2022-06-16 16:53:56 PDT
(In reply to Ahmad Saleem from comment #3)
> Created attachment 460285 [details]

^ APOLOGY - I pressed Enter by mistake.

I changed the test case from Comment 01 into JSFiddle below:

Testcase - https://jsfiddle.net/eLtjzy3n/show

I am unable to reproduce this bug in Safari 15.5 on macOS 12.4. All browsers (Chrome Canary 105 and Firefox Nightly 103) behaves same as Safari 15.5 and match each other. See attached "SAR" Screenshot. Thanks!
Comment 5 zalan 2022-06-16 20:37:05 PDT
Thank you for testing!