Note that there are some explanatory texts on larger screens.

plurals
  1. POCentred element off-centre after php
    text
    copied!<p>I'm getting a really confusing positioning problem. I have an <code>&lt;img&gt;</code> element with <code>display:block;margin-left:auto;margin-right:auto;</code>, which ought to centre it. The problem is that it's not centred within its container, but rather appears to be centred within the left half of its container.</p> <p>Complicating matters, this only occurs following a linked php file </p> <pre><code>&lt;div class="header"&gt; ... &lt;nav id="menu" class="topnav"&gt; &lt;ul&gt; &lt;li&gt;&lt;a class="navlink" href="alexandria.html"&gt;&lt;br style="clear: both;"/&gt;Alexandria&lt;br style="clear: both;"/&gt;&lt;span&gt;Referencing Manager&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a class="navlink" href="ceryneian.html"&gt;&lt;br style="clear: both;"/&gt;Ceryneian&lt;br style="clear: both;"/&gt;&lt;span&gt;Research Browser&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a class="navlink" href="blog"&gt;&lt;br style="clear: both;"/&gt;Blog&lt;br style="clear: both;"/&gt;&lt;span&gt;Thoughts&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a class="navlink" href="about.html"&gt;&lt;br style="clear: both;"/&gt;About&lt;br style="clear: both;"/&gt;&lt;span&gt;Our Team&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/nav&gt; </code></pre> <p> - if I remove this it works fine. <strong>Edit</strong> I've been testing my CSS, and it appears that if I remove the <code>float:right;</code> on the <code>&lt;ul&gt;</code>it works - I don't know why though, and I want to keep the float if possible.</p> <p>Here's the page in question <a href="http://fireoak.3owl.com/404.html" rel="nofollow">http://fireoak.3owl.com/404.html</a> - thanks in advance if you can be of any assistance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload