having trouble styling my contact us slider - css

I have been trying to style my "contact us" slider window but for my lack of knowledge (started website designing only a month back for my own project) I am kinda stuck.
The functionality is working great, but there are a few issues:
"contact us" text and a image that I am trying to get in a line is
not working.
in collapse mode, div containing text "contact us" is getting
reduced width wise.
Please excuse my not-so-technical language, since I am new to the concept.. Please refer my website koncreteplanet.com.. also, I have created a jsfiddle to give a glimpse of the code I am using (https://jsfiddle.net/jjff2o2x/). Thanks in advance!!
Javascript code:
jQuery("#ContactUs_header").click(function () {
jQuery('#slideContactUsbox').slideToggle('slow');
});
HTML / PHP code:
<div class="row">
<div class="col-md-8">
</div>
<div class="col-md-4" id="contactus-panel">
<div class="contactus-panel">
<div id="ContactUs_header" class="contactus_footer" >
<p>Contact Us</p>
<img align="right" width=auto height="40px" src= "<?php echo bloginfo('template_directory') . "/image/handshake.png" ; ?>">
</div>
<div id="slideContactUsbox" class="contactus-extended">
<div class="container" style="width:300px;align:left;" id="MailUs-Panel">
<form name="Form-MailUs" id="Form-MailUs" method="post" action=<?php echo (get_template_directory_uri() . "/contactus/html_form_send.php"); ?> >
<div class="">
<input type="text" class="form-control mailflds" name="first_name" id="first_name" maxlength="50" size="30" placeholder="Name">
</div>
<br>
<div>
<input type="text" class="form-control mailflds" name="email" id="email" maxlength="80" size="30" placeholder="E-Mail">
</div>
<br>
<div>
<input type="text" class="form-control mailflds" name="telephone" id="telephone" maxlength="30" size="30" placeholder="Mobile / Landline Number">
</div>
<br>
<div>
<textarea name="comments" id="comments" class="form-control mailflds" maxlength="1000" cols="25" rows="6" placeholder="Enter your comments"></textarea>
</div>
<br>
<div>
<Button class="btn btn-primary btn-block btn-custom" id="Submit_MailUs" name="Submit_MailUs">Submit</Button>
</div>
<div id="ack-mailus-err" style="color:red;font-family:garamond;font-size:18px;text-align:center;">
</div>
</form>
</div>
<div id="ack-mailus" style="color:green;font-family:garamond;font-size:18px;text-align:center;">
</div>
</div>
</div> <!-- end of contactus panel -->
</div>
</div>
CSS code
.contactus-panel{
position:fixed;
bottom:0;
z-index:9999;
}
.contactus_footer{
position:relative;
/*z-index: 10; */
/*float:right; */
text-align: left;
line-height: 1.5;
cursor: pointer;
padding: 5px 2px 4px 15px;
font-family:'Raleway', garamond, sans-serif;
font-size:20px;
background-color: #084000;
-webkit-border-radius: 10px 10px 0 0;
-moz-border-radius: 10px 10px 0 0;
border-radius: 10px 10px 0 0;
position: relative;
width: 100%;
vertical-align:center;
float:left;
}
.contactus_footer a {
color: #fff;
}
.contactus-extended{
background-color:#fff;
padding-top:20px;
padding-bottom:20px;
}

slideToggle() is jQuery method. Please using jQuery.
https://jsfiddle.net/pgqnjdvp/

I was able to resolve both parts of the issue.. can't believe it was that simple.. for part 2: I just added width exclusively to the container and it ceased to exist... also resolved part 1 of the issue.. added float and vertical-align:middle to both the text and img element styling too in addition to the div class and got the desired result.

Related

Removing a break line from the form text input

HTML:
<div class="form-row">
<div class="col-md-6 mb-3">
<label for="validationCustom03">Service</label>
<input type="text" class="form-control" id="validationCustom03" value="Describe service you need" required>
<div class="invalid-feedback">
Please write here a needed service.
</div>
</div>
</div>
CSS
#validationCustom03{
height: 100px;
}
input[id=validationCustom03]{
display:inline;
padding-top: 0px;
margin-top: 0px;
color:red;
}
Hello guys, I am trying to stylize the value of form - text input, but the only one thing I can reach is red color. My purpose is to remove break line before and after the text, to make is from the very first line in the input, please check out the picture. Thank you for your time and wisdom !
I think you should use a <textarea> form attribute instead of an <input> element. Here's an example:
#validationCustom03{
height: 100px;
}
textarea[id=validationCustom03]{
display:inline;
padding-top: 0px;
margin-top: 0px;
color:red;
}
<div class="form-row">
<div class="col-md-6 mb-3">
<label for="validationCustom03">Service</label><br>
<textarea rows="4" cols="50" name="comment" class="form-control" id="validationCustom03" form="usrform" value="Describe service you need" required>
Enter text here...</textarea>
<div class="invalid-feedback">
Please write here a needed service.
</div>
</div>
</div>
you don't have a break-line here. it is just because the height of the input field is much bigger than the size of the font.

I have a form I created and it looks great in all browsers but Firefox

My form on this page http://fashiondevelopmentgroup.com/
In the sidebar ENJOY OUR FREE NEWSLETTER is not looking right in Firefox. Everywhere else it is fine. Is there a way to code CSS specific to Firefox to fix this?
I have used the -moz-margin-start to set the horizontal css, but is there a specific vertical code for Firefox?
Thanks,
Brian
here is my code:
input, textarea, select {
vertical-align: middle;
color: #889291;
margin-left: 20px;
margin-top: 50px;
}
.button {
display: inline-block;
margin-left: 200px;
margin-top: -55px;
color: #fff;
background-color: #889291;
-moz-margin-start:67%;
-webkit-margin-start:70%;
}
HTML:
<div id="optin">
<form action="http://fashiondevelopmentgroup.us2.list-manage1.com/subscribe/post? u=1eed93a2e1bb3dc00d80e42af&id=25ea8ae595"; method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" style="background- image:url('HERE IS WHERE YOU WILL PUT THE LINK TO YOUR IMAGE THAT YOU UPLOADED');background-repeat: no-repeat; width:300px; height:151px;" novalidate>
<input type="email" size="30" value="Email Address" name="EMAIL" class="required email" id="mce-EMAIL" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;">
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div>
<div class="clear">
<input type="submit" value="SIGN UP" name="subscribe" id="mc-embedded-subscribe" class="button">
</div>
</form>
</div>
in your my_style.css line 8 you have a 50px margin-top for all input, textarea, and select elements. get rid of that so you can style individually for your situation.
then add position:relative you the parent div of the submit button. then add position:absolute; top:0;right:0; to your .button class.. this will align the button properly in firefox as well.
You will no longer need those margins in the .button class either. use the value in top: and right: to move the button exactly where you want it

how to get a form side by side to a div

I'm building a menu that scrolls down with the page for example Facebook's menu but i'm having trouble, the form seems to go under the div and i tried making it float left and it still doesn't work, i want to make it so their all lined up in a line.. what am i doing wrong?
here is my code
<div id="topnav">
<div id="nav">
<img src="/img/putlockermedia_logo.png" />
<input type="button" name="button" id="button" value="Shows" />
<input type="button" name="button" id="button" value="movies" />
<form action='/search.php' method='GET'>
<input id='searchbar' type='text' size='65' name='search' placeholder="search for movies & tv shows">
<input id='submit' type='submit' name='submit' value='Search' >
</form>
</div>
</div>
and here is the full css for it :)
<style>
#topnav{
background-color: #999;
height: 45px;
width: 100%;
position: fixed;
left:0px;
top: 0px;
}
#nav{
margin-left: 10px;
}
</style>
Add a wrapper div to the form and float it right
<div id="topnav">
<div id="nav">
<img src="/img/putlockermedia_logo.png" />
<input type="button" name="button" id="button" value="Shows" />
<input type="button" name="button" id="button" value="movies" />
<div id="right">
<form action='/search.php' method='GET'>
<input id='searchbar' type='text' size='65' name='search' placeholder="search for movies & tv shows">
<input id='submit' type='submit' name='submit' value='Search' >
</form>
</div>
</div>
</div>
CSS
<style>
#topnav{
background-color: #999;
height: 45px;
width: 100%;
position: fixed;
left:0px;
top: 0px;
}
#nav{
margin-left: 10px;
}
#right {
float:right
}
</style>
yes you have to use the float:left; width:50%; for form inside the div
check the fiddle link sample

Styling issue in IE

I am creating a questionnaire (I have little coding expertise) and am completely stuck with the styline in IE.
Firefox and Chrome both work perfectly but Internet Explorer won't center the content, the input fields are also overlapping the text areas.
I know the is a place for questions and not so much coding help but I thought someone might be able to notice something obvously wrong and save me a massive headache!
<body>
<style type="text/css">
#wrap {
width:800px;
margin:0 auto;
background-color:white;
height:auto;
margin-top:-16px;
}
#left_col {
float:left;
width:400px;
}
#right_col {
float:right;
width:400px;
}
body {
background-image:url(questionnaire-background.png);
font-family: calibri, verdana;}
</style>
<div id="wrap">
<center>
<br>
<h1>HR Newsletter Questionnaire</h1>
<div>
<p style="margin-top:20px">What is your name?</p><br>
<p><input type="text" name="name" style="margin-bottom: 43px; margin-top:-46px; width: 50%"></p>
</div>
<div>
<p>Is the HR Newsletter something you would like to receive?<p><br>
<p><input type="text" name="like_to_receive" style="margin-bottom: 43px; margin-top:-46px; width: 50%"></p>
</div>
<div>
<p>Comments:</p><br>
<p><input type="textarea" name="comments" style="margin-bottom: 43px; margin-top:-46px; width: 50%"></textarea></p>
</div>
<div>
<p>What do you like from the current HR Newsletters?</p><br>
<p><input type="text" name="what_do_you_like" style="margin-bottom: 43px; margin-top:-46px; width: 50%"></p>
</div>
<div>
<p>What do you do like or would like to be seen removed from the HR Newsletter?</p><br>
<p><input type="text" name="not_like" style="margin-bottom: 43px; margin-top:-46px; width: 50%"></p>
</div>
<div>
<p>What would you like to be seen added to the HR Newsletter?</p><br>
<p><input type="text" name="added" style="margin-bottom: 43px; margin-top:-46px; width: 50%"></p>
</div>
<div>
<p style="margin-bottom:-22px">How often would you like to see the HR Newsletter?</p><br>
<p>
<input type="radio" name="how_often" value="weekly">Weekly
<input type="radio" name="how_often" value="fortnightly">Fortnightly
<input type="radio" name="how_often" value="monthly">Monthly
<input type="radio" name="how_often" value="quartely">Quarterly
<input type="radio" name="how_often" value="yearly">Yearly<br></p>
</div>
<div>
<p style="margin-top: 40px; margin-bottom:-22px">Would you prefer the HR Newsletter to see more of less of the following:</p><br>
<p>
<input type="radio" name="would_you_prefer" value="more_pictures">More pictures with less text
<input type="radio" name="would_you_prefer" value="more_text">More text with less pictures
<input type="radio" name="would_you_prefer" value="both">A balanced mixture of both<br></p>
</div>
<div>
<p style="margin-top: 40px; margin-bottom:-22px">How long would you like the HR Newsletter to be?</p><br>
<p>
<input type="radio" name="how_long" value="9">Less than 9 pages
<input type="radio" name="how_long" value="10_15">10 – 15 Pages
<input type="radio" name="how_long" value="15">15 + Pages<br></p>
</div>
<br><br><br><br>
<div>
<p><input type="submit" value="Send" style="margin-bottom: 43px; margin-top:-46px; width: 50%">
<input type="reset" value="Clear" style="margin-bottom: 43px; margin-top:-46px; width: 50%"><br></p>
</div>
</center>
</div>
<body>
The easiest solution (and this is not really the best way to go about this, for the record) would be to add the following line in your CSS:
body { text-align:center; margin:0px auto; }
I checked this in IE 9.0.8.

nth-child first-child not working

trying to get the nth-child/first-child working
on the first label within the form below
but can't get it right
At the moment I'm using
form label {
display: block;
font-size: 20px;
font-size: 2rem;
line-height: 18px;
cursor: pointer;
margin:0 auto;
color:#FFF;
text-transform:uppercase;
padding:40px 0 10px;
font-weight: normal!important;
}
label:first-child {
padding-top:0;
}
but have used
form code div.field span.lspan label:nth-of-type(1)
form code div.field span.lspan label:first-child
.lspan label:first-child
form label:first-child
they set all labels in the form to padding 0
<form method="POST" action="" class="">
<div class="field">
<span class="lspan"><label for="sender_name">Name</label></span>
<span class="inspan"><input class="hinput" type="text" name="sender_name" value=""></span>
</div>
<div class="field">
<span class="lspan"><label for="sender_name">Email</label></span><span class="inspan"> <input class="hinput" type="text" name="email" value=""> </span></div>
<div class="field">
<span class="lspan"><label for="subject">Subject</label></span><span class="inspan"><input class="hinput" type="text" name="subject" value=""></span></div>
<div class="field">
<span class="lspan"><label for="sender_name">Message</label></span><span class="inspan"> <textarea class="htextarea" name="message"></textarea></span></div>
<div class="field">
</div>
<div class="field" style="margin-top:15px">
<input type = "submit" class="csubmit" name = "submit" value="Submit" style="" />
</div>
</form>
Thanks
Roy
All the <label> tags in your code are a first-child of their respective <span> element.
If you only want to target the first appearance of a <label> in your code use this:
form div:first-child label {
padding: 0;
}
This will target any label within the <div> element, that is the first-child of the form.
Remember, that you can use :first-child on any subselektor and not just on the outermost right!

Resources