Closed Bug 291977 Opened 20 years ago Closed 20 years ago

center-problem with <div>-tag`s

Categories

(Core :: Layout, defect)

1.0 Branch
x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: jash.1, Unassigned)

Details

(Keywords: testcase)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:1.7.7) Gecko/20050414 Firefox/1.0.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:1.7.7) Gecko/20050414 Firefox/1.0.3

Hi,

ive found out some problems with the <div>-tag`s, exactly it is impossible to
center them. When i try to center a div within a div using "text-align: center;"
in the css-file it wont center the div, it shows it at the left border. The same
problem is when i try to center a div within a table, without div its all fine
centered, but when i put a <div>-tag around the text the table is at the left side.
The source should be below i hope, 1st time i use bugzilla and i hope u
understand what i mean.

Reproducible: Always

Steps to Reproduce:
the source

<html>
 <head>
  <style type="text/css">
  .testdiv
  {
   background-color: #00FF00;
   width: 200px;
  }
   table.test
   {
    width: 500px;
   }
   td.test
   {
    background-color: #FF1C00;
    width: 500px;
    text-align: center;
   }
  </style>
 </head>
 <body>
  <table class="test">
   <tr>
    <td class="test">
     <div class="testdiv">
      blubb
     </div>
    </td>
   </tr>
  </table>
 </body>
</html>

remove the div-tag and it is centered.
Actual Results:  
As described above, it doesn`t center div-tag`s.

Expected Results:  
Hmmm, i think to center the content would be ok.
Keywords: testcase
Assignee: firefox → nobody
Component: General → Layout
Product: Firefox → Core
QA Contact: general → layout
Version: unspecified → 1.0 Branch
If you want to center the div, you have to add margin-left:auto; and
margin-right:auto; to .testdiv.
text-align doesn't work for block elements, only for inline elements. This bug
is invalid.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
So not a dupe of bug 276466?
No, although there are probably a lot of other bugs which handle this same
issue: where people think text-align should do the same as what margin-left and
margin-right are doing.
In this case sry, but others didn`t know this resolution also, and that only ff
shows this problems it was strange.
No need to apologize :)
See bug 243090, comment 1 for where this is explained a bit more.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: