WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Why won't my sidebar move? (12 posts)

  1. brittanywigand
    Member
    Posted 4 years ago #

    This is the code in my style.css:

    div#sidebar {
    	float: left;
    	width: 20.5%;
    	margin-top: 10px;
    	margin-left: -20%;
    	text-align: left;

    Whenever I change the values of margin-left, absolutely nothing happens. Whenever I change float: left; to center or something the side bars go way down the page. Whenever I change the width: 20.5%; to say 100% the side bars go way down the page.

    I'm trying to move it over a smidge to the right. What can I do?

    The code in sidebar.php is this just incase it has to do anything with it...

    <!--sidebar.php-->
    </div><!-- content end--></div><!-- wrapper end-->
    <div id="sidebar">
    
    <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Right Sidebar') ) : else : ?>
    
    <?php if (function_exists('get_search_form')) {  get_search_form();
    }else { include (TEMPLATEPATH . '/searchform.php');} ?>
    
    <?php if (function_exists('wp_theme_switcher')) { ?>
    	<h2><?php _e('Themes'); ?></h2>
    	<?php wp_theme_switcher(); ?>
    <?php } ?>
    <?php endif; ?>
    </div><!--sidebar end-->
    
    <div id="navigation">
    <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Left Navigation') ) : else : ?>
    
    <?php _e('<img src="http://img190.imageshack.us/img190/7748/nav3edited.png">','mtsjourney'); ?>
    <p><?php bloginfo('description'); ?></p>
    <a href="/olderposts">Older Posts</a><br />
    <a href="/contact">Contact</a>	
    
    	<?php endif; ?>
    </div><!--navigation end-->
    <!--sidebar.php end-->
  2. irengba
    Member
    Posted 4 years ago #

    submit the link to your blog .

  3. meamusta
    Member
    Posted 4 years ago #

    It is rather difficulty to say what you should do. It may be some other div that prevents your sidebar from moving.

    If you are using Firefox browser you could try to add Firebug extension to it. With Firebug you can play with css and see the changes right away. It is very handy tool for debugging css.

    After installing Firebug you see a small "bug" in the right bottom corner of your browser, that's where you can start the extension.

  4. brittanywigand
    Member
    Posted 4 years ago #

    my site is brittanywigand.com... even if I could just move the search bar would be fine.

  5. Mark / t31os
    Moderator
    Posted 4 years ago #

    Can't see any sidebar on your site..

    You might wish to note, that the following will not work in some browsers.

    html {
    	color: # ;
    	background-image: url(http://img20.imageshack.us/img20/4163/backgroundvqe.png);
    	background-position: top-left;
    	background-repeat: repeat;
    }

    Styling the HTML tag is not reliable... use the body tag for your main background...

  6. brittanywigand
    Member
    Posted 4 years ago #

    t31os_ there is a left and ride sidebar on my site, here's the code in style.css for them:

    /*--sidebar on the right--*/
    #sidebar h2 {
    	border-top: 3px double #688f9e;
    	border-bottom: 1px solid #688f9e;
    	margin: 14px 0 14px 4px;
    	padding-left: 5px;
    	line-height: 1.6em;
    }
    div#sidebar ul {
    	margin: 2px 4px 9px 4px;
    	padding: 2px 3px;
    }
    div#sidebar ul ul {
    	margin: 0;
    	padding: 2px 0;
    }
    div#sidebar ul li,       div#sidebar ul li ul li {
    	list-style-type: none;
    	margin: 0;
    	padding: 2px 0 0 12px;
    	background-image: url(images/mts-links-li.gif);
    	background-repeat: no-repeat;
    	background-position: 0 8px;
    	line-height: 1.6em;
    }
    
    div#sidebar ul li.current_page_item, div#sidebar ul li ul li.current_page_item,
    div#sidebar ul li.current-cat, div#sidebar ul li ul li.current-cat {
      background-image: url(images/mts-links-li-current.gif);
    	background-repeat: no-repeat;
    	background-position: 0 8px;
    }
    
    div#sidebar  .rss li {
    	background-image: none;
    }
    div#sidebar a b {
    	font-weight: normal;
    }

    and here's the sidebar.php code:

    <!--sidebar.php-->
    </div><!-- content end--></div><!-- wrapper end-->
    <div id="sidebar">
    
    <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Right Sidebar') ) : else : ?>
    
    <?php if (function_exists('get_search_form')) {  get_search_form();
    }else { include (TEMPLATEPATH . '/searchform.php');} ?>
    
    <?php if (function_exists('wp_theme_switcher')) { ?>
    	<h2><?php _e('Themes'); ?></h2>
    	<?php wp_theme_switcher(); ?>
    <?php } ?>
    <?php endif; ?>
    </div><!--sidebar end-->
    
    <div id="navigation">
    <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Left Navigation') ) : else : ?>
    
    <?php _e('<img src="http://img190.imageshack.us/img190/7748/nav3edited.png">','mtsjourney'); ?>
    <p><?php bloginfo('description'); ?></p>
    <a href="/olderposts">Older Posts</a><br />
    <a href="/contact">Contact</a>	
    
    	<?php endif; ?>
    </div><!--navigation end-->
    <!--sidebar.php end-->

    I'd be happy with just being able to move the search bar to the right a little more without the left sidebar moving with it...

  7. Mark / t31os
    Moderator
    Posted 4 years ago #

    Are you copying and pasting from word or some other word processor, your webpage is riddled with unclosed or unopen elements...

    See here.

    It would be a bit pointless trying to fix layout problems when you have more then 100 invalidations.. any number of these could attribute toward layout problems.

    You really need to start with fixing those problems first...

  8. irengba
    Member
    Posted 4 years ago #

    hi brittanywigand,
    in your style.css find "div#sidebar" and replace with
    div#sidebar {
    float:right;
    margin-left:-30%;
    margin-top:10px;
    position:relative;
    right:-217px;
    text-align:left;
    top:1px;
    }

    In here just change the value of "right" and adjust to your requirements. If you need more help just let me know.

  9. brittanywigand
    Member
    Posted 4 years ago #

    Irengba, won't that move the whole entire sidebar? I just want to move the right sidebar because my search bar is there.

  10. irengba
    Member
    Posted 4 years ago #

    That style is to move the right sidebar. Just apply and check it out..

  11. brittanywigand
    Member
    Posted 4 years ago #

    Irengba, I'm having trouble now on my site's main page... my left side bar is waaaaay down and my right side bar is in the perfect place. Help?!

  12. brittanywigand
    Member
    Posted 4 years ago #

    Nevermind, I'm using a different theme now. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic