how to use css for positioning my checkboxes in lines let's say of 4. For now the're displaying all in one line.
I tried with floating left and margin but it's not working the way I do it.
I have 7 groups of lists like below in my form
HTML:
<div class="Oobj" id="Oobj60">
<form action="mailto:kontakt#2know.pl" method="post" enctype="text/plain">
<div id="Oobj58">
<input type="checkbox" onClick="toggle(this)" /><br>
<input type="checkbox" name="sport" value="fitness" />fitness<br />
<input type="checkbox" name="sport" value="gym" />siłownia<br />
<input type="checkbox" name="sport" value="siata" />siatkówka<br />
<input type="checkbox" name="sport" value="noga" />piłka nożna<br />
<input type="checkbox" name="sport" value="kosz" />koszykówka<br />
<input type="checkbox" name="sport" value="zima" />sporty zimowe<br />
</div>
</form> </div>
CSS:
#Oobj58 {
position: absolute;
font-size: 13px;
font-family: Open Sans;
z-index: 43;
text-align: left;
left: 12.25em;
top: 23.00em;
display: none;
}
class 'Oobj' is empty. I needed it for another jq code.
try this
<div class="Oobj" id="Oobj60">
<form action="mailto:kontakt#2know.pl" method="post" enctype="text/plain">
<div id="Oobj58">
<ul>
<li> <input type="checkbox" name="sport" value="fitness" />fitness </li>
<li> <input type="checkbox" name="sport" value="gym" />siłownia</li>
<li> <input type="checkbox" name="sport" value="siata" />siatkówka</li>
<li> <input type="checkbox" name="sport" value="noga" />piłka nożna</li>
<li> <input type="checkbox" name="sport" value="kosz" />koszykówka</li>
<li> <input type="checkbox" name="sport" value="zima" />sporty zimowe</li>
</ul>
</div>
</form> </div>
#Oobj58 {
font-size: 13px;
font-family: Open Sans;
text-align: left;
left: 12.25em;
top: 23.00em;
}
#Oobj58 ul li { display:inline; margin-left:10px; }
Related
div input:not(:first-of-type){
display: block;
}
#left_side{
width: 40%
}
label{
width:15em;
display: inline-block;
vertical-align: top;
}
input{
width: 23em;
border-style:solid;
border:1px solid black;
}
.group div{
margin-bottom: -1px;
}
.group input {
margin-bottom: -1px;
box-shadow: none;
background-color: antiquewhite;
}
.get{
width:23em;
display: inline-block;
}
<div class="group">
<div>
<label for="first_name">First Name:</label>
<input type="text" id="first_name" class="get">
</div>
<div>
<label for="last_name">First Name:</label>
<input type="text" id="last_name" class="get">
</div>
</div>
<!--Here is some code with grouped boxes:-->
<div>
<label for="address_1_ln_1">Address 1:</label>
<div class="get">
<input type="text" id="address_1_ln_1">
<input type="text" id="address_1_ln_2">
</div>
</div>
<div>
<label for="address_2_ln_1">Address 2:</label>
<div class="get">
<input type="text" id="address_1_ln_1">
<input type="text" id="address_2_ln_2">
</div>
</div>
<div>
<label for="city">City:</label>
<input type="text" id="city" class="get">
</div>
<div>
<label for="state">State:</label>
<input type="text" id="state" class="get">
</div>
<dive>
<label for="zip">Zip:</label>
<input type="text" id="zip" class="get">
</dive>
How do you make text input of forms overlap borders like border: collapse on a table? By default stacking them one on top of the other has them develop a 2px border between adjacent inputs. Ideally both the borders should merge.
You could do
input {
margin-bottom: -1px;
}
I need to do the same as here:
http://deinehelfer24.de/renovierungen/
As I understand it, this is done on contact form 7, but how are the images and multiple selections implemented?
I feel generous today, simpe example ho you can style labels
https://jsfiddle.net/Beneris/65mdtpo3/28/
HTML
<form>
<div class="input-group">
<div class="input-wrap">
<input type="radio" name="group1" id="group1-1" value="1">
<label for="group1-1">
<figure><img src="http://placekitten.com/g/100/100"><h3>Radio 1</h3></figure>
</label>
</div>
<div class="input-wrap">
<input type="radio" name="group1" id="group1-2" value="2">
<label for="group1-2">
<figure><img src="http://placekitten.com/g/100/100"><h3>Radio 2</h3></figure>
</label>
</div>
<div class="input-wrap">
<input type="radio" name="group1" id="group1-3" value="3">
<label for="group1-3">
<figure><img src="http://placekitten.com/g/100/100"><h3>Radio 3</h3></figure>
</label>
</div>
</div>
<div class="input-group">
<div class="input-wrap to-toggle 1 3">
<input type="checkbox" name="group2" id="group2-1" value="1">
<label for="group2-1">
<figure><img src="http://placekitten.com/g/100/100"><h3>checkbox 1</h3></figure>
</label>
</div>
<div class="input-wrap to-toggle 1 2">
<input type="checkbox" name="group2" id="group2-2" value="2">
<label for="group2-2">
<figure><img src="http://placekitten.com/g/100/100"><h3>checkbox 2</h3></figure>
</label>
</div>
<div class="input-wrap to-toggle 1 2 3">
<input type="checkbox" name="group2" id="group2-3" value="3">
<label for="group2-3">
<figure><img src="http://placekitten.com/g/100/100"><h3>checkbox 3</h3></figure>
</label>
</div>
</div>
</form>
CSS
.radio-group {
display:block;
}
.input-group .input-wrap{
display:inline-block;
vertical-align: top;
padding: 10px;
}
label figure {
background-color: #ccc;
padding: 5px 10px;
border-radius: 0 0 5px 5px;
cursor: pointer;
}
figure h3 {
text-align: center;
}
.input-group input:checked ~ label figure {
background-color: red;
}
.input-wrap input {
display:none;
}
JS
$('.to-toggle').hide();
$('input[name=group1]').on('change', function(){
var val = $(this).val();
$('.to-toggle').hide();
$('.to-toggle input').prop('checked', false);
$('.to-toggle.' + val).show();
//alert(val);
});
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.
I am new to CSS and have been trying to create a web form with the radio buttons aligned next to text fields. However, in Firefox the radio boxes look fine, but when I check in Safari the radio boxes are in the middle of the text fields.
The CSS looks like this:
input#answers
{
display: block;
height: 31px;
left: 87px;
position: relative;
top: 0px;
width: 350px;
}
input[type="radio"]
{
display: inline- block;
height: 20px;
left: 249px;
position: relative;
top: -30px;
vertical-align: middle;
}
and the HTML like this:
<form id="quizCreator" name="quizCreator" method="post" action="quiz.maker.php">
<label><span><img src="images/quizcreatorText.ques.png" hspace="79px" vspace="70px" class="titles" /></span> <br />
<input type="text" name="question" id="question" />
</label>
<label><img src="images/quizcreatorText.ans.png" hspace="79px" vspace="70px" class="titles" id="ans" /> <br />
<input type="hidden" name="creator" value="myform" />
<br />
<input type="text" name="answer1" id="answers" />
</label>
<label>
<input type="radio" name="radio" id="radio1" value="radio1" />
</label>
<label>
<input type="text" name="answer2" id="answers" />
</label>
<label>
<input type="radio" name="radio" id="radio3" value="radio2" />
</label>
<label>
<input type="text" name="answer3" id="answers" />
</label>
<label>
<input name="radio" type="radio" class="radio" id="radio3" value="radio3" />
</label>
<label>
<input type="text" name="answer4" id="answers" />
</label>
<label>
<input name="radio" type="radio" id="radio4" value="radio4" />
</label>
<span><input type="image" src="images/quiznameText.next.png" name="nextPage" id="nextPage" class="nxtbutton" /></span>
</form>
I've tried using relative positioning and margins, but while it fixes the problems in Safari, Firefox then looks wrong. Is there a way to make them both work as I want with a single set of code? (And what about MSIE?)
You should not be using relative positioning for this.
The proper structure is something like this (not sure if you want the text before or after):
<div class="answers">
<ul>
<li><label>your text</label><input type="radio" /></li>
...repeat...
</ul>
</div>
CSS:
.answers ul, .answers li {
list-style-type:none;
margin:0;
padding:0;
}
.answers li {
clear:both
}
.answers label {
display:block;
float:left;
width:100px;
}
.answers input {
display:block;
float:left;
}
I am trying to create a fairly basic form with in my maincontent. I am sure I am coding things incorrectly and it is driving me crazy. Note my code. I get extremely wide vertical spacing in IE 7 and the bacground color between the field sets does not work correctly. All is good in FF.
My CSS is:
fieldset {
margin: 1.5em 0 0 0;
padding: 0;
border-style: none;
border-top: 1px solid #BFBAB0;
background-color: #FFFFFF;
}
legend {
margin-left: 1em;
color: #000000;
font-weight: bold;
}
fieldset ol {
padding: 1em 1em 0 1em;
list-style: none;
}
fieldset li {
padding-bottom: 1em;
}
fieldset.submit {
border-style: none;
}
{
var w = document.myform.mylist.selectedIndex;
var selected_text = document.myform.mylist.options[w].text;
alert(selected_text);
}
label em {
display: block;
color: #900;
font-size: 85%;
font-style: normal;
text-transform: uppercase;
}
This is my html code.
<div id="mainContent1">
<form name="myform">
<label for="mylist"><strong>Select an Account Type:</strong></label>
<select name="mylist"><option value="traditional">Traditional Account</option>
<option value="paperless">Paperless Account</option>
</select>
</form>
<br /><a> </a>
<form action="example.php">
<fieldset>
<legend>Contact Details</legend>
<ol>
<li>
<label for="name">Name:</label>
<input id="name" name="name" class="text" type="text" />
<label for="name">
<em>required</em>
</label>
</li>
<li>
<label for="email">Email address:</label>
<input id="email" name="email" class="text" type="text" />
<label for="name">
<em>required</em>
</li>
<li>
<label for="phone">Telephone:</label>
<input id="phone" name="phone" class="text" type="text" />
<label for="name">
<em>required</em>
<ol>
<li>
<input id="option1" name="option1"
class="checkbox" type="checkbox" value="1" />
<label for="option1">Savings</label>
</li>
<li>
<input id="option2" name="option2"
class="checkbox" type="checkbox" value="1" />
<label for="option2">Checkings</label>
</li>
</ol>
</fieldset>
<fieldset>
<legend>Delivery Address</legend>
<ol>
<li>
<label for="address1">Address 1:</label>
<input id="address1" name="address1" class="text"
type="text" />
</li>
<li>
<label for="city">City:</label>
<input id="city" name="city" class="text" type="text" />
</li>
<li>
<label for="postcode">Zip Code:</label>
<input id="postcode" name="postcode"
class="text textSmall" type="text" />
</li>
<li>
<label for="country">Country:</label>
<input id="country" name="country" class="text" type="text" />
</li>
</ol>
</fieldset>
<fieldset class="submit">
<input class="submit" type="submit" value="Submit" />
</fieldset>
<fieldset class="clear">
<input class="clear" type="clear"
value="Submit" />
</fieldset>
</form>
First, get rid of the script in your CSS file...
Firefox/compliant browsers and IE treat legends and fieldsets very differently, unfortunately... that may be the problem you're seeing:
http://www.456bereastreet.com/lab/styling-form-controls-revisited/fieldset/
make sure there is a "#" before your id's and a "." before your classes in your css file. not doing so causes confusion.