Hey all- having a little trouble positioning some “Enter your email address” text over a form. It vertically centers itself on my mac browsers but no dice on pc. I’m picking up original code (that i dont fully understand) and manipulating it to fit my new needs so im sure theres just some error in translation. The functionality is working, i just cant figure out how to center the overlaid text. If anyone can figure out where my prob is exactly it would be appreciated.
css:
.subscribe_form_bg2{position:relative; background-image:url(/stage/media/sweepstakes/boxbg.gif); width:264px;height:28px;z-index:100; float:left; margin:-20px 26px 0 32px; float:right; }
.subscribe_button_bg2{position:relative; background-color:#cccccc; border:2px solid #dbdbdb; width:19px;height:38px;z-index:100;float:left;margin:-18px 0 0 3px; }
.subscribe_button_bg2 span {text-align:center; margin-right:1px}
.form-subscribe2 { float:right; padding:5px 0 0 0; position:relative;width:302px; }
.form-subscribe2 input.input-text2
{
background-color:white;
background-image:url(/stage/media/sweepstakes/boxbg.gif);
color:#A1A1A1;
float:left;
font:bold 14px Arial;
height:38px;
margin:0px;
padding:0;
position:absolute;
width:264px;
z-index:120;
border:none;
vertical-align:middle;
}
.form-subscribe2 .validation-advice { width:341px ; float:left; position:relative;}
.form-subscribe2 .v-fix { text-align:right; padding-right:5px; float: right; height:40px; width:360px; }
.form-subscribe2 a { color:#777; }
.form-subscribe2 button {width:31px; height:30px;position:relative; float:right;background-image:url(/stage/media/sweepstakes/gobtn.gif);margin:4px 0 0 3px;background-repeat:no-repeat}
.form-subscribe2 div.button { cursor:pointer; width:31px; height:30px;position:relative; float:right;background-image:url(/stage/media/sweepstakes/gobtn.gif);margin:4px 0 0 3px;background-repeat:no-repeat;}
*:first-child+html .form-subscribe button { height:22px;}
.advice-validate-email-newsletter{position:relative; z-index:130px; border:none; background-color:transparenrt; margin:0; width:320px ; float:left;}
.advice-required-entry-newsletter{ }
/*.subscribe_label{float:left;width:140px; height:18px}*/
and html:
<div id="container">
<form id="newsletter-validate-detail" action="https://www.susanb.com/newsletter/subscriber/new/" method="post"> <!-- form commented by nikoolin -->
<div class="form-subscribe2"><!--
<div class="subscribe_button_bg2"><span>GO</span></div>
<div class="subscribe_form_bg2"></div>
-->
<div class="f-fix">
<script type="text/javascript">// <![CDATA[
url = document.location.href;
if( url.lastIndexOf('https') > -1 ){ http = 'https'; }else{ http = 'http'; }
// nikoolin eway subscriber
var eway_subscriber_pixel_first_part = '<img src="' + http + '://link.e.susanb.com/s/link/su?rc=cp&rti=w8128&email=';var eway_subscriber_pixel_second_part = '&formalTitle=SusanB_signup" mce_src="' + http + '://link.e.susanb.com/s/link/su?rc=cp&rti=w8128&email=';var eway_subscriber_pixel_second_part = '&formalTitle=SusanB_signup" border="0" width="1" height="1" />'; console.log( ' eway_subscriber_pixel_first_part :'+ eway_subscriber_pixel_first_part ); console.log( ' eway_subscriber_pixel_second_part :'+ eway_subscriber_pixel_second_part );
function eway_subscribe()
{
jQuery('#advice-validate-email-newsletter2').css('display','none');
var email = document.getElementById('newsletter').value;
console.log( 'email: ' + email );
console.log( 'email.lastIndexOf(): ' + email.lastIndexOf('@',0) );
//if( email.lastIndexOf('@',0) > 0 )
//{
jQuery.noConflict();
if( !jQuery('#newsletter').hasClass('validation-failed') )
{
jQuery( window.eway_subscriber_pixel_first_part + email + window.eway_subscriber_pixel_second_part ).appendTo('body');
console.log( 'eway subscribed: ' + window.eway_subscriber_pixel_first_part + email + window.eway_subscriber_pixel_second_part );
jQuery('.away-top-everypage').css('display','block');
console.log( jQuery('#newsletter').hasClass('validation-failed') );
jQuery('.logo').focus();
}
else
{
jQuery('.away-top-everypage').css('display','none');
}
//};
if( email == 'Enter your email address' )
{
jQuery('#advice-validate-email-newsletter2').css('display','block');
jQuery('#newsletter').addClass('validation-failed');
}
}
// nikoolin eway subscriber
// ]]></script>
<div class="button" title="Subscribe" onclick=" eway_subscribe(); "><span> </span></div>
<!-- <button type="submit" class="button" title="Subscribe" onclick=" eway_subscribe(); " ><span></span></button> --> <input id="newsletter" class="input-text2 required-entry validate-email" onclick="this.value==' ENTER YOUR EMAIL ADDRESS'?this.value='':''" name="email" type="text" value=" ENTER YOUR EMAIL ADDRESS" />
<div id="advice-validate-email-newsletter2" class="validation-advice" style="display: none;">ENTER YOUR EMAIL ADDRESS</div>
</div>
</div>
</form>
</div>