Sidebar div position problem
-
Hey all, my sidebar which I’ve placed in a div is not moving to it’s correct position but instead is lining up under the main content.
here’s the code:
</div> <--! content end --> </div> <--! column-left end --> <div id="column-right"> <?php get_sidebar(); ?>
Column-right is what I want to put the sidebar into, so that’s why I’ve open the “column-right” div before the “get sidebar php” (however the same problem occurs when it’s inside the sidebar php but I’ll get to that later) The “Column-right” div is closed inside the sidebar php.
So here’s my question can you open div tags outside let’s say the sidebar but have it close inside it?
-
<!-- Get Side bar starts --> <em> <div id="column-right"></em> <div id="colours"> <p>Pick a colour:</p> <a id="red" href="" rel="1" onClick="set_style(this);return false;">red</a> <a id="yellow" href="" rel="2" onClick="set_style(this);return false;">yellow</a> <a id="green" href="" rel="3" onClick="set_style(this);return false;">green</a> <a id="blue" href="" rel="4" onClick="set_style(this);return false;"class="on">blue</a> <a id="pink" href="" rel="5" onClick="set_style(this);return false;">pink</a> <br style="clear:both;" /> </div> <?php /* Widgetized sidebar, if you have the plugin installed. */ if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?> <h3><strong>Search</strong> all posts</h3> <form method="get" id="searchform" action="<?php bloginfo('url'); ?>/"> <div> <label class="hidden" for="s"> <?php _e('Search for:'); ?> </label> <input type="text" value="<?php the_search_query(); ?>" name="s2" id="s2" /> <input type="submit" class="button" value=">" /> </div> </form> <div class="hr"></div> <h3><strong>Featured</strong> posts</h3> <em></div></em> <!-- Get sidebar ends -->
here’s the sidebar code with the “column-right” div inside it but the same thing happens.
Also here’s the stylesheet for Column right
div#container div#column-right{ float:right; width:230px; display:inline; margin:300px -2px 0 0;
I have an open div in the header (column-Left) and closes in the main index php which could be the the cause but I’m not sure.
Yeah! fixed it, turned out I didn’t end the div tag. but now I’ve got aload of random </div>’s that I don’t know are for.. :-S
- The topic ‘Sidebar div position problem’ is closed to new replies.