Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I center my logo image to another div in CSS horizontally and vertically?
    primarykey
    data
    text
    <p>I need help positioning a logo horizontally center. It also needs to be centered vertically to the top of my links <code>div</code>. Can someone help me?</p> <p>I'd like my logo to look like this: <img src="https://i.stack.imgur.com/mOue2.jpg" alt="enter image description here"></p> <p>Below is my HTML and CSS:</p> <p><strong>HTML -</strong> <a href="http://codebin.org/view/199faa14" rel="nofollow noreferrer">http://codebin.org/view/199faa14</a></p> <pre><code>&lt;div id="container"&gt; &lt;div id="logo"&gt; &lt;img src="images/images/logo.gif" /&gt; &lt;/div&gt; &lt;div id="navigation"&gt; navigation &lt;/div&gt; &lt;div id="header"&gt; &lt;/div&gt; &lt;div id="line"&gt; &lt;/div&gt; &lt;div id="content"&gt; content &lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>CSS -</strong> <a href="http://codebin.org/view/dda88d94" rel="nofollow noreferrer">http://codebin.org/view/dda88d94</a></p> <pre><code>body { background: url(../images/images/bg_page.gif) center center; } #container { width: 940px; margin: 0 auto; } #header { height: 281px; background: url(../images/home/header.gif) top center; position: relative; } #logo { position: absolute; z-index: 2; top: 0px height: 214px; margin: 10px auto 0 auto; } #navigation { position: relative; height: 40px; background: #fff; margin-top: 100px } #content { height: 541px; background: url(../images/home/bg_body.png) top center; position: relative; } #line { height: 4px; background: url(../images/home/line.gif) top center; position: relative; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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