Support » Themes and Templates » Adding input button throws off width in Twenty Twelve

  • Resolved fluxappeal

    (@fluxappeal)


    A simple task of adding a button to the bottom of a custom template is throwing off the width of my content area. I added the code after the loop, and tried it with and without divs, but I can’t get the page to go full width. The entire content area cuts off.

    Here’s the page: http://www.arthurtaussig.com/test-purchase-button/
    and the code:

    get_header(); ?>
    
    	<div id="primary" class="site-content">
    		<div id="content" role="main">
    
    			<?php while ( have_posts() ) : the_post(); ?>
    				<?php get_template_part( 'content', 'page' ); ?>
    				<?php comments_template( '', true ); ?>
    			<?php endwhile; // end of the loop. ?>
    
                <div class="container clearfix">
    
                    <div class="button_purchase">
    
              		  <a href="url-link-here"><input type="button" value="Purchase" class="button_purchase" /></a>
    
                    </div><!-- #button_purchase -->
    
               </div><!-- #clearfix -->
    
          </div><!-- #content -->
    
    	</div><!-- #primary -->
    
    <?php get_footer(); ?>

    I’m sure it’s something obvious, but it escapes me. Thank you 😉

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,
    First a disclaimer – I hope you are using a child theme or a Custom CSS Plugin for the changes you are creating or they will be lost with the next update.

    That said, are you using a smaller width on any pages? If not, in line 1437 of your style.css, you have

    .site-content {
      float: left;
      width: 65.1042%;
    }

    which seems to be throwing off this page. If you make this width 100%, it should give you a full width on that page.

    If you need to keep that 65% for other pages, you can try adding this:

    body.page-template-single-full-widthgallery-php .site-content {
        width: 100%;
    }

    There seems to be a problem with those body classes being put together. I’m not sure why they are not separated, but this should fix your problem.

    Hope this helps.

    Thread Starter fluxappeal

    (@fluxappeal)

    Hello Laura,

    Yes, I am using a child theme;)

    I had modified the site content to full width, but had missed this 600px media query setting at 65%. Not sure why it was only affecting this one page, but your solution did the trick.

    Thank you so much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding input button throws off width in Twenty Twelve’ is closed to new replies.