Note that there are some explanatory texts on larger screens.

plurals
  1. PODon't want DIVs in header to overlap
    primarykey
    data
    text
    <p>in the I'm painfully new to CSS (and stackoverflow!) and can't seem to get the divs in my header to line up and not overlap. I have a logo image with align="absmiddle" so that the h1 text is to the right of it, which is the way I want it. I want another line of text with the business contact information in small text below the h1 (still to the right of the logo). When I add the div with the contact info it shows up behind the logo instead. I've seen a lot of questions and solutions for people wanting an overlap and for issues with different browsers and resizing but can't seem to find something simple that asks what I'm asking. Appreciate your help.</p> <p>Here's the html:</p> <pre><code>&lt;body&gt; &lt;div id="outer-container"&gt; &lt;div id="header"&gt; &lt;div id="main-logo"&gt; &lt;h1&gt;&lt;a href="#"&gt;&lt;img src="images/Murray_Logo.gif" alt="Murray logo" width="144" height="144" align="absmiddle" /&gt;Company name here&lt;/a&gt;&lt;/h1&gt; &lt;/div&gt; &lt;br clear= "all" /&gt; &lt;div id= "contactinfo"&gt;address&lt;/div&gt; &lt;div id="main-menu"&gt; &lt;ul&gt; &lt;li class="first-item"&gt; &lt;a href="#"&gt;Home&lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="#"&gt;Services&lt;/a&gt; &lt;/li&gt; &lt;li class="last-item"&gt; &lt;a href="#"&gt;Testimonials&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p>and the CSS:</p> <pre><code>* { padding: 0; margin: 0; } a { color: #2D80D2; text-decoration: underline; } a:hover { text-decoration: none; } body { font-size: 11.5pt; line-height: 1.5em; color: #404040; background: #FFFFFF url('images/bg1.gif') repeat-x top left; } body,input { font-family: Georgia, serif; } br.clear-all { clear: both; } h1,h2,h3,h4 { letter-spacing: -1px; } h1,h2 { font-family: Century, serif; } h2 { font-size: 1.75em; } h2,h3,h4 { margin-bottom: 0.75em; color: #000; } h3 { font-size: 1.5em; } h4 { font-size: 1em; } p { margin-bottom: 1.25em; } ul { margin-bottom: 1.25em; } ul h4 { margin-bottom: 0.3em; } #header { height: 175px; position: relative; padding: 20px; } #outer-container { position: relative; width: 1200px; /* was 980px */ margin: 90px auto 0 auto; } #inner-container { padding: 0; position: relative; width: 980px; margin: 25px 0 15px 0; } #inner-container .features { padding-left: 0; list-style: none; } #inner-container .features li { padding: 10px 0 10px 0; clear: both; } #inner-container ul { list-style: none; } #inner-container ul li { border-top: dashed 1px #B3B3B3; padding: 5px 0 5px 0; } #inner-container ul li.first-item { border-top: 0; padding-top: 0; } #main-logo { height: 145px; /* 6/7/12 DH */ left: 20px; line-height: 107px; position: absolute; top: 0; } #main-logo a { text-decoration: none; color: #000; } #main-logo h1 { font-size: 2.2em; } #main-logo p { font-size:1em; } #main-logo img { padding: 0 20px 0 0; } #main-menu { width: 940px; border-bottom: solid 1px #1467B9; bottom: 0; border-top: solid 1px #5AADFF; line-height: 53px; margin: 0 0 0 0; padding: 0 20px 0 20px; height: 53px; left: 0; background: #1E71C3 url('images/bg2.gif') repeat-x top left; position: absolute; } #main-menu a { color: #FFF; /*letter-spacing: -1px; /* 6/7/12 DH */ text-decoration: none; } #main-menu ul { list-style: none; } #main-menu ul li { display: inline; padding: 0 10px 0 10px; } #main-menu ul li.first-item { padding-left: 0; } #contactinfo { font-family:Tahoma, Geneva, sans-serif; font-size:10px;; } #contactinfo a { color: #404040; } </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.
    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