0

On my site if you scroll all the way to the bottom of the side bar (on the right hand side) you'll see a email sign up box I'm trying to make (via a text widget.) I've tried all day to get this to work correctly, and can't figure it out. One thing works, and another breaks. I'm not sure if I should post what it is in my text widget or what's in my style.css here for you guys to look it. Maybe someone can check the link and see if they can see what happening. I'll be glad to post the code if needed. The theme is responsive using Twitter bootstrap.

Here is my custom.css (this is a child theme) Feel free to let me know if I need to change any of this.

/* ------------------------------------------------------------------------ Import Standard Styles */

@import url( '../standard3/style.css' );

/* ------------------------------------------------------------------------ Customizations */
#disqus_thread {
    clear: both!important;
    background: white;
    background: white;
    margin: 0 0 40px 0;
    position: relative;
    border-radius: 4px;
    -moz-border-radius: 4px;
    -webkit-border-radius: 4px;
    -webkit-box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.2),transparent 0 0 0,transparent 0 0 0,transparent 0 0 0,transparent 0 0 0;
    -moz-box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.2),transparent 0 0 0,transparent 0 0 0,transparent 0 0 0,transparent 0 0 0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2),transparent 0 0 0,transparent 0 0 0,transparent 0 0 0,transparent 0 0 0;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    padding: 0 20px;
}

.dsq-comment-text p
{
color: black;
font-size: 13px;
font-weight: normal;
line-height: 18px;
}



.widget .signupForm {
    /* Box always has colour, pic always on right */
    background-color: #06d0d2;
    background-image: url(http://noahsdad.com/wp-content/uploads/2012/05/noah-side-bar1.jpg);
    background-position: right bottom;
    background-repeat: no-repeat;

    /* height ensures full pic is shown  */
    height: 300px;    

    /* allow us to position contents */
    position: relative;
}

/* Absolutely position the form within the widget */
.widget .signupForm form {
 position: absolute;
 right: 160px;  
 bottom: 70px;
}

.widget .signupForm form input {
 display: block;
}


//* now just resize the widget box and move the form */

    .widget .signupForm {
        width: 300px;
        height: 240px;
        background-size: 100%;    
    }

    .widget .signupForm form {
        right: 120px;   
        bottom: 50px;
    }
}

/* adjust slightly for larger sizes */
@media screen and (min-width: 980px) {
    .widget .signupForm {
        width: 343px;
        height: 275px;
        background-size: 100%;    
    }

    .widget form .signupForm {
        right: 160px;   
        bottom: 70px;
    }
}


/* ------------------------------------------------------------------------ Media Queries */

/* Smartphones */
@media (max-width: 480px) {

}

/* Tablet and Mobile */
@media (max-width: 979px) {    

}

/* Mobile to Tablet */
@media only screen and (max-width: 767px) {

}


/* Landscape Tablets */
@media (min-width: 768px) and (max-width: 979px) {

}

/* Desktop */
@media (min-width: 980px) {

}
tw16
  • 29,215
  • 7
  • 63
  • 64
Rick Smith
  • 1,245
  • 3
  • 15
  • 22

1 Answers1

1

The answer is very simple. The background-image you are using has a width of 370px, but #sidebar which houses the widget only has a width of 300px.

Solution 1
You need to reduce your image to the correct width using imaging software or increase the width of the the #sidebar.

Solution 2
Or you can change the position of the background so that the text bubble is not the part being cut off.

.widget .signupForm{ background-position: -19px 0;}

Solution 3
You can use CSS3 to fit the background-image using background-size:

.widget .signupForm{ background-size: contain; }

Support is limited though: https://developer.mozilla.org/en/CSS/background-size

EDIT : Based on CSS being posted

You can use the original size image you had. The rule that already has background-size declared is getting lost because of this line of CSS:

//* now just resize the widget box and move the form */

Remove the first forward slash and all the CSS should work properly:

/* now just resize the widget box and move the form */

And to position the form out of the way of the image change all of the rules that say .widget .signupForm form:

.widget .signupForm form {
    bottom: 50px; /* change to 0 */
    right: 120px;
}
tw16
  • 29,215
  • 7
  • 63
  • 64
  • hey thanks. :) What's strange is the image on the top of the side bar is 370. Any idea why that one is showing up correctly? – Rick Smith May 18 '12 at 01:44
  • Yes, it's because for the top one you've used an `` which is resizeable so it is fitting to the space it has, where as a `background-image` is not resizeable without the help of CSS3. – tw16 May 18 '12 at 01:46
  • Ok, I did solution number 1, but now there is a strange blue background color above the image and the form / button don't show up in the right place. (Thanks for the help by the way.) – Rick Smith May 18 '12 at 01:50
  • @tw16 if you look at the jsfiddle, he uses the same image but it resizes there - its only on the site it doesn't resize... I've asked for the OP to post the CSS from the site in case its different from the jsfiddle – FluffyKitten May 18 '12 at 01:52
  • @FluffyKitten: That is because in the fiddle the OP is using `.widget {background-size: 100%;}` which is what I describe above as the CSS3 solution. – tw16 May 18 '12 at 01:54
  • @tw16 why won't that work on the site if the css is the same? – FluffyKitten May 18 '12 at 01:55
  • @FluffyKitten that's what I hope to find out. I can't figure out what is happening. – Rick Smith May 18 '12 at 02:15
  • 1
    @RickSmith in `.widget .signupForm` you have `height: 300px;`, but the image is only 243. Also, you might want to put `bottom: 0;` on `.widget .signupForm form` – MiniGod May 18 '12 at 02:19
  • @RickSmith me either! tw16 seemed to have an idea... I hope someone can help you because I'm afraid I'm stumped, sorry! – FluffyKitten May 18 '12 at 02:19
  • @MiniGod Thanks. I changed the height (you can check out the link and what it did) Where do I add that bottom: 0; ? – Rick Smith May 18 '12 at 02:22
  • 1
    The issue was with an invalid character in the css, a stray forward slash. If you look at my solution now you will see the solution. – tw16 May 18 '12 at 02:22
  • @tw16 BOOM!!! You are the man! THANKS SO MUCH! Now I need to figure out how to move the subscribe box and button. Should I make another post for that, or is it something fairly simple? – Rick Smith May 18 '12 at 02:30
  • @RickSmith: No need for another question. I have explained in the answer above. Very simple. Don't forget to vote up and mark as accepted. – tw16 May 18 '12 at 02:33
  • @RickSmith put `bottom: 0;` on `.widget .signupForm form` which is on line 80 in your css – MiniGod May 18 '12 at 02:33
  • @tw16 Thanks. But do I add that everywhere? For instance '.widget .signupForm { /* Box always has colour, pic always on right */ background-color: #06d0d2; background-image: url(http://noahsdad.com/wp-content/uploads/2012/05/noahs-dad-side-bar.jpg); background-position: right bottom; background-repeat: no-repeat; /* height ensures full pic is shown */ height: 243px; /* allow us to position contents */ position: relative; " ? Also should I add that "bottom 0" like MiniGod suggested? – Rick Smith May 18 '12 at 02:35
  • 1
    @RickSmith: As I said in the answer you are just changing the rules that apply to `.widget .signupForm form` (the one you have posted in the comment above is not the same) and already have `bottom` declared. Then you are changing that bottom value to 0. – tw16 May 18 '12 at 02:37
  • @tw16 Ok! I think it's correct now. You mind double checking? (I'm going to put my updated css above) – Rick Smith May 18 '12 at 02:40
  • It looks good, but I have rolled back the question to the previous css as otherwise it wouldn't make sense to people seeing the question in the future. – tw16 May 18 '12 at 02:43
  • @tw16 ok. Thanks so much for your help. Where were you 12 hours ago. :) – Rick Smith May 18 '12 at 02:46