treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Sidebar in Single View

  • Can anyone help with the sidebar on my new blog? The problem is in IE 7 in the single view it is pushed below the main content but I can't figure out how to get it to line up. On the homepage it's where it should be hung out to the right but in single view it just drops below the content and I'm out of ideas now to get it to line up.

    Site here: http://graemepirie.com
  • Hi Gpirie,

    I initially thought it was a problem with floats but I figured out what the problem was . Your sidebar was not in your

    Content DIV.

    You need a container ( in your case your div called content ) and the only thing inside there was the main col. The sidebar was actually not in your content div it was sitting below it floated to the right.

    Here is the code , you need to cut the sidebar code and paste it between the closing divs .

    If you have any trouble with it let me know.

    Andrew


    <div class=\"content\">	

    <div class=\"main-col\">


    <div class=\"posts\" id=\"post-39\">
    <h2>
    The Life of A Modern Day Student </h2>

    <div class=\"postdate\">
    <p>

    Posted by: Graeme on Mon January 12th, 2009

    </p>

    </div>

    <p>With it being my first day back at University, this little video shows that it&#8217;s not all drinking and partying!</p>
    <p><object width=\"425\" height=\"344\" data=\"http://www.youtube.com/v/dGCJ46vyR9o&amp;hl=en&amp;fs=1\" type=\"application/x-shockwave-flash\"><param name=\"allowFullScreen\" value=\"true\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"src\" value=\"http://www.youtube.com/v/dGCJ46vyR9o&amp;hl=en&amp;fs=1\" /><param name=\"allowfullscreen\" value=\"true\" /></object></p>

    <p>Tags: <a href=\"http://graemepirie.com/tag/education/\" rel=\"tag\">education</a>, <a href=\"http://graemepirie.com/tag/students/\" rel=\"tag\">students</a>, <a href=\"http://graemepirie.com/tag/time-spent/\" rel=\"tag\">time spent</a>, <a href=\"http://graemepirie.com/tag/workload/\" rel=\"tag\">Workload</a></p>
    <p>
    <!--This entry was posted

    on Monday, January 12th, 2009 at 10:03 pm and is filed under <a href=\"http://graemepirie.com/category/university/\" title=\"View all posts in University\" rel=\"category tag\">University</a>.
    You can follow any responses to this entry through the <a href='http://graemepirie.com/the-life-of-a-modern-day-student/feed/'>RSS 2.0</a> feed.


    You can <a href=\"#respond\">leave a response</a>, or <a href=\"http://graemepirie.com/the-life-of-a-modern-day-student/trackback/\" rel=\"trackback\">trackback</a> from your own site.
    -->

    </p>

    </div>


    <!-- You can start editing here. -->


    <!-- If comments are open, but there are no comments. -->



    <h3 id=\"respond\">Leave a Reply</h3>


    <form action=\"http://graemepirie.com/wp-comments-post.php\" method=\"post\" id=\"commentform\">


    <div id=\"add-comment\">

    <div class=\"details\">

    <div class=\"nameform\">

    <label for=\"author\">Name (*)</label>
    <input type=\"text\" name=\"author\" id=\"author\" value=\"\" size=\"22\" tabindex=\"1\" aria-required='true' />

    </div>

    <div class=\"emailform\">

    <label for=\"email\">Mail (Not Published) (*)</label>
    <input type=\"text\" name=\"email\" id=\"email\" value=\"\" size=\"22\" tabindex=\"2\" aria-required='true' />


    </div>

    <div class=\"websiteform\">

    <label for=\"url\">Website</label>
    <input type=\"text\" name=\"url\" id=\"url\" value=\"\" size=\"22\" tabindex=\"3\" />

    <label>*Required</label>

    </div>

    </div>


    <div class=\"inputbox\">

    <div class=\"commentbox\">

    <textarea name=\"comment\" id=\"comment\" cols=\"42\" rows=\"10\" tabindex=\"4\"></textarea>

    </div>

    <button class=\"comment\">Submit Comment</button>
    <input type=\"hidden\" name=\"comment_post_ID\" value=\"39\" />

    <div class=\"tags\">
    <strong>XHTML:</strong> You can use these tags: <code>&lt;a href=&quot;&quot; title=&quot;&quot;&gt; &lt;abbr title=&quot;&quot;&gt; &lt;acronym title=&quot;&quot;&gt; &lt;b&gt; &lt;blockquote cite=&quot;&quot;&gt; &lt;cite&gt; &lt;code&gt; &lt;del datetime=&quot;&quot;&gt; &lt;em&gt; &lt;i&gt; &lt;q cite=&quot;&quot;&gt; &lt;strike&gt; &lt;strong&gt; </code>
    </div>

    </div>

    </div>
    </form>







    </div>


    ******delete these asterisks and paste your sidebar here make sure it is inside these two closing divs*******************


    </div>


    cut out all the text between the two lines of asterisks below
    *****************************************************************************************************************************


    <div id=\"sidebar\">

    <div id=\"sidebar-content\">




    <!-- Author information is disabled per default. Uncomment and fill in your details if you want to use it.
    <li><h2>Author</h2>
    <p>A little something about you, the author. Nothing lengthy, just an overview.</p>
    </li>
    -->


    <div id =\"feed\">

    <a href=\"http://feeds2.feedburner.com/GraemePirie\">Grab the RSS Feed!</a>

    </div>


    <div id=\"twitter\">

    <h2>Twitter</h2>

    <div id=\"twitter_div\">
    <ul id=\"twitter_update_list\"></ul>
    <br />
    Follow me on <a href=\"http://twitter.com/gpirie\">Twitter</a>
    </div>
    <p>
    <script type=\"text/javascript\" src=\"http://twitter.com/javascripts/blogger.js\"></script>
    </p>

    <p>
    <script type=\"text/javascript\" src=\"http://twitter.com/statuses/user_timeline/gpirie.json?callback=twitterCallback2&amp;count=1\"></script>
    </p>
    </div>

    </div>

    <div id=\"categories\">

    <div id=\"categories-content\">

    <ul>
    <li class=\"categories\"><h2>Categories</h2><ul> <li class=\"cat-item cat-item-12\"><a href=\"http://graemepirie.com/category/apple/\" title=\"View all posts filed under Apple\">Apple</a> (1)
    </li>
    <li class=\"cat-item cat-item-5\"><a href=\"http://graemepirie.com/category/blogging/\" title=\"View all posts filed under Blogging\">Blogging</a> (2)
    </li>
    <li class=\"cat-item cat-item-51\"><a href=\"http://graemepirie.com/category/cms/\" title=\"View all posts filed under CMS\">CMS</a> (1)
    </li>
    <li class=\"cat-item cat-item-46\"><a href=\"http://graemepirie.com/category/hosting/\" title=\"View all posts filed under Hosting\">Hosting</a> (1)
    </li>
    <li class=\"cat-item cat-item-52\"><a href=\"http://graemepirie.com/category/learning/\" title=\"View all posts filed under Learning\">Learning</a> (9)
    </li>
    <li class=\"cat-item cat-item-13\"><a href=\"http://graemepirie.com/category/new-products/\" title=\"View all posts filed under New Products\">New Products</a> (3)
    </li>
    <li class=\"cat-item cat-item-26\"><a href=\"http://graemepirie.com/category/seo/\" title=\"View all posts filed under SEO\">SEO</a> (1)
    </li>
    <li class=\"cat-item cat-item-30\"><a href=\"http://graemepirie.com/category/social-networks/\" title=\"View all posts filed under Social Networks\">Social Networks</a> (2)
    </li>
    <li class=\"cat-item cat-item-18\"><a href=\"http://graemepirie.com/category/technology/\" title=\"View all posts filed under Technology\">Technology</a> (8)
    </li>
    <li class=\"cat-item cat-item-67\"><a href=\"http://graemepirie.com/category/university/\" title=\"View all posts filed under University\">University</a> (4)
    </li>
    <li class=\"cat-item cat-item-3\"><a href=\"http://graemepirie.com/category/web-design/\" title=\"View all posts filed under Web Design\">Web Design</a> (14)
    </li>
    <li class=\"cat-item cat-item-58\"><a href=\"http://graemepirie.com/category/web-development/\" title=\"View all posts filed under Web Development\">Web Development</a> (5)
    </li>
    <li class=\"cat-item cat-item-7\"><a href=\"http://graemepirie.com/category/workload/\" title=\"View all posts filed under Workload\">Workload</a> (2)
    </li>
    </ul></li> </ul>
    </div>

    </div>


    <div id=\"blogroll\">

    <div id=\"blogroll-content\">
    <ul>

    <div id=\"flickrlogo\">

    <h2>Flickr</h2>

    </div>

    <div id=\"flickr\">

    <a href=\"http://www.flickr.com/photos/gpirie/3293211683/\" title=\"Italy Team Bus\"><img src=\"http://farm4.static.flickr.com/3466/3293211683_4b706315f3_t.jpg\" alt=\"Italy Team Bus\" /></a><a href=\"http://www.flickr.com/photos/gpirie/3293211503/\" title=\"Post-Match\"><img src=\"http://farm4.static.flickr.com/3449/3293211503_65edb3edfa_t.jpg\" alt=\"Post-Match\" /></a><a href=\"http://www.flickr.com/photos/gpirie/3294035626/\" title=\"Post-Match\"><img src=\"http://farm4.static.flickr.com/3348/3294035626_f7713562b0_t.jpg\" alt=\"Post-Match\" /></a><a href=\"http://www.flickr.com/photos/gpirie/3293211081/\" title=\"Pre-Match Warm Up\"><img src=\"http://farm4.static.flickr.com/3099/3293211081_d35c87ab17_t.jpg\" alt=\"Pre-Match Warm Up\" /></a><a href=\"http://www.flickr.com/photos/gpirie/3293210887/\" title=\"Italian Team Hotel\"><img src=\"http://farm4.static.flickr.com/3181/3293210887_ed431d2f0a_t.jpg\" alt=\"Italian Team Hotel\" /></a><a href=\"http://www.flickr.com/photos/gpirie/3294035000/\" title=\"Italian Team Hotel\"><img src=\"http://farm4.static.flickr.com/3457/3294035000_490f182437_t.jpg\" alt=\"Italian Team Hotel\" /></a><a href=\"http://www.flickr.com/photos/gpirie/3293210441/\" title=\"Italian Team Hotel\"><img src=\"http://farm4.static.flickr.com/3552/3293210441_32366508c0_t.jpg\" alt=\"Italian Team Hotel\" /></a><a href=\"http://www.flickr.com/photos/gpirie/3293210217/\" title=\"Italian Team Hotel\"><img src=\"http://farm4.static.flickr.com/3430/3293210217_68e77fc4da_t.jpg\" alt=\"Italian Team Hotel\" /></a>
    </div>




    </div>

    </div>

    </div>
    *****************************************************************************************************************************
    <div class=\"clear\"></div>


    <div class=\"clear\"></div>
  • Thankyou! :D

    Can't believe I missed that, I was looking at the floats and widths etc instead of that.

    Thanks again!
  • no problemo glad i could help