hi, i cannot arrange the contents of a div inside, i used the command text-align:center and doesn't work. What can i do?
here's a link of the css, you can find the problem at #footer{}

Dani AI

Generated

Quick diagnosis and context: tried the inline-text centering approach but didn’t see the result inside the footer; ’s test with a simple paragraph shows inline text can center, but recommending the old HTML alignment attribute is outdated. The real issue is usually a mismatch between what you’re trying to center (inline text vs a block-level child, table, floated or absolutely positioned element) and the centering method used.

If the child is a block-level element (including tables), give it a width and center with automatic horizontal margins:

#footer .centered-child {
  width: 600px;
  margin: 0 auto;
}

For simple horizontal and vertical centering of any content, make the footer a flex container:

#footer {
  display: flex;
  justify-content: center; /* horizontal */
  align-items: center;     /* vertical */
  height: 120px;
}

Troubleshooting checklist: confirm the element you want to center is not floated (floats prevent margin auto from centering), not absolutely positioned (absolute positioning needs left:50% + transform or different handling), and that the child actually has a set width when using margin auto. Use browser DevTools to inspect computed display, width, and margins. If you need to center a table, prefer CSS (margin auto) over old HTML attributes.

Useful references: A Complete Guide to Centering in CSS and MDN’s guide to the relevant layout properties, for examples and browser notes.

Your footer is working correctly.
You need to use <table align="center"> to centrally align a table.
If you add a <p>Hello World</p> in your footer you should see it in the middle.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.