문제

I'm working on the unbounce landing page platform. Overall, it's really awesome and makes A/B testing pretty easy. It's more or less just drag and drop, but you're able to add css, html, javascript, etc.

Anyway, I'm working on creating a fixed signup area on the bottom of the screen (should boost conversions), but I'm having some troubles. The signup box is created within the wysiwyg dashboard, and from what I see it just builds the CSS for you, as you move sliders, change colors and such.

I'm able to make the entire signup area float right to the bottom, but I can't get the signup box to stay centered. I can use margins and positioning, but not the align: center function.

I've tried doing margin-left: auto; margin-right: auto as well as text-align: center; but it does absolutely nothing!

When changing the size of the screen, it just will not stay centered. But here's the kicker; the text has no problem centering with just width: 100%.. The signup box doesn't seem to respect any wrapper and I'm thinking this might be the problem. This is all the CSS I'm using to create this fixed section:

 #lp-pom-box-214 {
    top: auto !important;
    display:block;
    position:fixed;
    margin-left: auto;
    margin-right: auto;
    bottom:0px;
    width: 100%;
    align: center;

  }     

 #lp-pom-form-51 {
   top: auto !important;
    display:block;
    width: 100%;
    position:fixed;
    bottom: 25px;
    margin-left: 26%;

  }

  #lp-pom-text-211 {
    top: auto !important;
    display:block;
    position:fixed;
    bottom:75px;
    width: 100%;        
  }

Thanks a TON in advance!! This client is really good to me, so I want to do a good job for them. I'm not a great coder, but I'm very good at marketing so feel free to give me a shout if you need help in that arena :) That's the best way I know how to give back to whoever helps me out (or anyone else in the community for that matter).

Thanks again.

도움이 되었습니까?

해결책

You can't adjust the position of a fixed positioned element in this way.

A fixed position element is positioned relative to the viewport, or the browser window. The viewport doesn't change when the window is scrolled, so a fixed positioned element will do exactly as the name implies and remain fixed in it's assigned position. To position a fixed element you use the properties top, right, bottom, and left

If you want to keep it as a fixed positioned element you can vertically and horizontally center it on the page by setting top and left to 50% so as the left-top corner of the container is centered within the page, you can then use margin-top and margin-left with negative values to compensate for half of the width and height of the element to achieve true center within the center of your container.

다른 팁

Something like this?

if yes check this code

css

.fixed-bottom {
    position:fixed;
    left:0;
    bottom:0;
    padding:10px 0;
    background:#CCC;
    width:100%;
}
.fixed-bottom h1 {
    text-align:center;
}

#lp-pom-button-52 {
display: block;
z-index: 61;
width: 175px;
height: 54px;
line-height: 54px;
behavior: url(/PIE.htc);
border-radius: 8px;
background-color: #ff0000;
background: -webkit-linear-gradient(#ff0000,#e60000);
background: -moz-linear-gradient(#ff0000,#e60000);
background: -ms-linear-gradient(#ff0000,#e60000);
background: -o-linear-gradient(#ff0000,#e60000);
background: linear-gradient(#ff0000,#e60000);
box-shadow: inset 0px 1px 0px #ff4c4c,inset 0 -1px 2px #b30000;
text-shadow: 1px 1px #5c0000;
-pie-background: linear-gradient(#ff0000,#e60000);
color: #fff;
border-style: solid;
border-width: 3px;
border-color: #333333;
font-size: 24px;
font-weight: bold;
font-family: arial;
text-align: center;
background-repeat: no-repeat;
    float:left;
    margin:0 0 0 10px;
}

#lp-pom-form-51 .lp-pom-form-field input[type=text] {
border-style: solid;
border-width: 10px;
border-color: #002c77;
}

a {
color: #ff0000;
text-decoration: none;
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top