Is that possible to create a new line (like <br/>in html ) inside of a previous form-row.
Here is what I have. I would like to put "Recherche" in a new line (but i still want to keep it inside the form-row div).
Do you have an idea ?
http://jsfiddle.net/aq9Laaew/96443/
Thanks !
Change the <form> class. Like this:
Old:
<form class="form-inline" name="formFiltre" id="formFiltre" method="post">
New:
<form class="form" name="formFiltre" id="formFiltre" method="post">
Working example:
.row {
background: #f8f9fa;
margin-top: 20px;
}
.col {
border: solid 1px #6c757d;
padding: 10px;
}
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<script src="http://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
<link href="http://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet"/>
<script src="http://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<div class="form-row">
<div class="col-lg-12">
<form class="form" name="formFiltre" id="formFiltre" method="post">
<input type="hidden" name="nav" value="1" />
<label for="recherche">Arborescence</label>
<select name="rf_arbo[0]" id="rf_arbo0" class="form-control rf_arbo" style="margin: 1%">
<option value="">-- choisir --</option>
<option value="7">Toutes</option>
<option value="2">Offre du moment</option>
<option value="6">Témoignages</option>
<option value="8">Loi de défiscalisation</option>
</select>
<!-- SAUT DE LIGNE -->
<label for="recherche">Recherche</label>
<input type="text" name="rf_recherche" id="rf_recherche" class="form-control" value="" style="margin: 1%" />
<select name="rf_statut" id="rf_statut" class="form-control" style="margin: 1%">
<option value="">-- statuts --</option>
<option value="v1">En ligne</option>
<option value="v0">Hors ligne</option>
</select>
<select name="rf_accueil" id="rf_accueil" class="form-control" style="margin: 1%">
<option value="">-- accueil --</option>
<option value="v1">Affiché</option>
<option value="v0">Non affiché</option>
</select>
<input type="submit" class="btn" value="Rechercher" />
</form>
</div>
</div>
Related
I implemented drop down select tags but i want to add the border to the tags like the below image.
Just like the below image i want to add the border to the container. Iam unable to identify for which div i want to add the border. Any work would be really appreciable.
.
<!doctype html>
<style>html { font-size: 14px; font-family: Arial, Helvetica, sans-serif; }</style>
<link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.2.607/styles/kendo.common-material.min.css" />
<link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.2.607/styles/kendo.material.min.css" />
<link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.2.607/styles/kendo.default.mobile.min.css" />
<script src="//kendo.cdn.telerik.com/2016.2.607/js/jquery.min.js"></script>
<script src="//kendo.cdn.telerik.com/2016.2.607/js/kendo.all.min.js"></script>
<div id="example" role="application" style="float:left;width:49%; margin-right:2%">
<div id="select" class="demo-section k-content">
<h4 style="margin-top: 2em;">select</h4>
<select id="size" placeholder="Select size..." style="width: 140px;" >
<option />easy
<option />to
<option />code
<option />way
<option />always
<option />easily
</select>
</div>
</div>
<div id="example1" role="application" style="float:left;width:49%;margin-right:0;margin-left: -28%;">
<div id="select" class="demo-section k-content">
<h4 style="margin-top: 2em;">select</h4>
<select id="size1" placeholder="Select size..." style="width: 140px;" >
<option />C++
<option />java
<option />jquery
<option />html
<option />css
<option />unix
</select>
</div>
</div>
<div id="example2" role="application" style="float:left;width:49%;margin-right:0;margin-left: -26%;">
<div id="select" class="demo-section k-content">
<h4 style="margin-top: 2em;">select</h4>
<select id="size2" placeholder="Select size..." style="width: 140px;" >
<option />php
<option />framworks
<option />are
<option />good
<option />to
<option />code
</select>
</div>
</div>
<div id="example3" role="application" style="float:right;width:49%;margin-right: -110px;
margin-top: -100px;">
<div id="select" class="demo-section k-content">
<h4 style="margin-top: 2em;">select</h4>
<select id="size3" placeholder="Select size..." style="width: 140px;" >
<option />google
<option />yahoo
<option />are
<option />good
<option />search
<option />engines
</select>
</div>
</div>
<script>
$(document).ready(function() {
// create ComboBox from input HTML element
// create ComboBox from select HTML element
$("#size").kendoComboBox();
$("#size1").kendoComboBox();
$("#size2").kendoComboBox();
$("#size3").kendoComboBox();
var select = $("#size").data("kendoComboBox");
var select = $("#size1").data("kendoComboBox");
var select = $("#size2").data("kendoComboBox");
var select = $("#size3").data("kendoComboBox");
});
</script>
</!doctype>
Just add a container around all your selects and add a border to it. Check out the snippet!
<!doctype html>
<style>html { font-size: 14px; font-family: Arial, Helvetica, sans-serif; }</style>
<link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.2.607/styles/kendo.common-material.min.css" />
<link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.2.607/styles/kendo.material.min.css" />
<link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.2.607/styles/kendo.default.mobile.min.css" />
<script src="//kendo.cdn.telerik.com/2016.2.607/js/jquery.min.js"></script>
<script src="//kendo.cdn.telerik.com/2016.2.607/js/kendo.all.min.js"></script>
<div style=" overflow: hidden;
border: 1px solid gray;
padding: 10px;">
<div id="example" role="application" style="float:left;width:49%; margin-right:2%">
<div id="select" class="demo-section k-content">
<h4 style="margin-top: 2em;">select</h4>
<select id="size" placeholder="Select size..." style="width: 140px;" >
<option />easy
<option />to
<option />code
<option />way
<option />always
<option />easily
</select>
</div>
</div>
<div id="example1" role="application" style="float:left;width:49%;margin-right:0;margin-left: -28%;">
<div id="select" class="demo-section k-content">
<h4 style="margin-top: 2em;">select</h4>
<select id="size1" placeholder="Select size..." style="width: 140px;" >
<option />C++
<option />java
<option />jquery
<option />html
<option />css
<option />unix
</select>
</div>
</div>
<div id="example2" role="application" style="float:left;width:49%;margin-right:0;margin-left: -26%;">
<div id="select" class="demo-section k-content">
<h4 style="margin-top: 2em;">select</h4>
<select id="size2" placeholder="Select size..." style="width: 140px;" >
<option />php
<option />framworks
<option />are
<option />good
<option />to
<option />code
</select>
</div>
</div>
<div id="example3" role="application" style="float:right;width:49%;margin-right: -110px;
margin-top: -100px;">
<div id="select" class="demo-section k-content">
<h4 style="margin-top: 2em;">select</h4>
<select id="size3" placeholder="Select size..." style="width: 140px;" >
<option />google
<option />yahoo
<option />are
<option />good
<option />search
<option />engines
</select>
</div>
</div>
</div>
<script>
$(document).ready(function() {
// create ComboBox from input HTML element
// create ComboBox from select HTML element
$("#size").kendoComboBox();
$("#size1").kendoComboBox();
$("#size2").kendoComboBox();
$("#size3").kendoComboBox();
var select = $("#size").data("kendoComboBox");
var select = $("#size1").data("kendoComboBox");
var select = $("#size2").data("kendoComboBox");
var select = $("#size3").data("kendoComboBox");
});
</script>
</!doctype>
Just add container div to dropdowns and change the dropdown container css as in below
<!doctype html>
<style>
html {
font-size: 14px;
font-family: Arial, Helvetica, sans-serif;
}
.container{
border: 1px solid #ddd;
display: inline-block;
padding: 10px 30px 50px 30px;
}
</style>
<link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.2.607/styles/kendo.common-material.min.css" />
<link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.2.607/styles/kendo.material.min.css" />
<link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.2.607/styles/kendo.default.mobile.min.css" />
<script src="//kendo.cdn.telerik.com/2016.2.607/js/jquery.min.js"></script>
<script src="//kendo.cdn.telerik.com/2016.2.607/js/kendo.all.min.js"></script>
<div class="container">
<div id="example" role="application" style="float:left; margin-right:10px">
<div id="select" class="demo-section k-content">
<h4 style="margin-top: 2em;">select</h4>
<select id="size" placeholder="Select size..." style="width: 140px;">
<option />easy
<option />to
<option />code
<option />way
<option />always
<option />easily
</select>
</div>
</div>
<div id="example1" role="application" style="float:left;margin-right:10px;">
<div id="select" class="demo-section k-content">
<h4 style="margin-top: 2em;">select</h4>
<select id="size1" placeholder="Select size..." style="width: 140px;">
<option />C++
<option />java
<option />jquery
<option />html
<option />css
<option />unix
</select>
</div>
</div>
<div id="example2" role="application" style="float:left;margin-right:10px;">
<div id="select" class="demo-section k-content">
<h4 style="margin-top: 2em;">select</h4>
<select id="size2" placeholder="Select size..." style="width: 140px;">
<option />php
<option />framworks
<option />are
<option />good
<option />to
<option />code
</select>
</div>
</div>
<div id="example3" role="application" style="float:left;margin-right:10px;">
<div id="select" class="demo-section k-content">
<h4 style="margin-top: 2em;">select</h4>
<select id="size3" placeholder="Select size..." style="width: 140px;">
<option />google
<option />yahoo
<option />are
<option />good
<option />search
<option />engines
</select>
</div>
</div>
</div>
<script>
$(document).ready(function () {
// create ComboBox from input HTML element
// create ComboBox from select HTML element
$("#size").kendoComboBox();
$("#size1").kendoComboBox();
$("#size2").kendoComboBox();
$("#size3").kendoComboBox();
var select = $("#size").data("kendoComboBox");
var select = $("#size1").data("kendoComboBox");
var select = $("#size2").data("kendoComboBox");
var select = $("#size3").data("kendoComboBox");
});
</script>
</!doctype>
I removed the spacing between multiple input fields and the submit button using float:left.
But I dont know how to keep this hole block centered on the page.
Here is a Fiddle:https://jsfiddle.net/bb61c412/43/
And the code:
.form-control {
float: left;
border-radius: 0px;
}
.btn {
float: left;
border-radius: 0px;
}
<link rel="stylesheet" type="text/css" href="https://bootswatch.com/bower_components/bootstrap/dist/css/bootstrap.min.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<div class="col-sm-12 col-lg-12" style="margin-left:0px;padding-right:0px;margin-top:50px;padding-left:0px; height:100vh;">
<div style="background-color:white;width:100%;height:100%;">
<div style="margin-left:30px;margin-right:50px;padding-top:30px;">
<form>
<div class=form-inline style='text-align:center;'>
<select name="Form1" class="form-control">
<option value="0">Form1</option>
<option value="1">Option2</option>
<option value="2">Option3</option>
</select>
<select name="Form2" class="form-control">
<option value="0">Form2</option>
<option value="1">Option2</option>
<option value="2">Option3</option>
</select>
<select name="Form3" class="form-control">
<option value="0">Form3</option>
<option value="1">Option2</option>
<option value="2">Option3</option>
</select>
<button type="submit" class="btn btn-default">Submit</button>
</div>
</form>
</div>
</div>
</div>
Remove the floats and use flexbox instead.
JSfiddle Demo
.form-control {
border-radius: 0px;
}
.btn {
border-radius: 0px;
}
.form-inline {
display: flex;
justify-content: center;
}
.form-control {
border-radius: 0px;
}
.btn {
border-radius: 0px;
}
.form-inline {
display: flex;
justify-content: center;
}
<link rel="stylesheet" type="text/css" href="https://bootswatch.com/bower_components/bootstrap/dist/css/bootstrap.min.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<div class="col-sm-12 col-lg-12" style="margin-left:0px;padding-right:0px;margin-top:50px;padding-left:0px; height:100vh;">
<div style="background-color:white;width:100%;height:100%;">
<div style="margin-left:30px;margin-right:50px;padding-top:30px;">
<form>
<div class=form-inline style='text-align:center;'>
<select name="Form1" class="form-control">
<option value="0">Form1</option>
<option value="1">Option2</option>
<option value="2">Option3</option>
</select>
<select name="Form2" class="form-control">
<option value="0">Form2</option>
<option value="1">Option2</option>
<option value="2">Option3</option>
</select>
<select name="Form3" class="form-control">
<option value="0">Form3</option>
<option value="1">Option2</option>
<option value="2">Option3</option>
</select>
<button type="submit" class="btn btn-default">Submit</button>
</div>
</form>
</div>
</div>
</div>
Otherwise you will have to review How to remove the space between inline-block elements?
Please try this:
Change:
<div style="margin-left:30px;margin-right:50px;padding-top:30px;">
to
<div style="margin: 0px auto; padding-top: 30px; width: 427px;">
It is best practice to have all your .js files or CDN(s) at the bottom of your HTML before the closing body tag.
You want to render your .js scripts last to help with your asset pipeline.
Any idea why this code stopped working? (Wordpress)
My site - The main search bar 'city' 'neighborhood' 'min price' etc isn't responding, I can't input text and have no clue what I've done to bung it up.
The code seems to be clean though when I input it in the codepen, something on my site is mucking this up!
<form id="sp_search_w" action="http://www.codytritter.com/listing/" method="get">
<input name="sp" type="hidden" value="s" />
<label for="sp_city">City</label>
<input id="sp_city" class="btn-block" name="sp_city" type="text" placeholder="City" />
<label for="sp_subdivision">Sub Division</label>
<input id="sp_subdivision" class="btn-block" name="sp_subdivision" type="text" placeholder="Neighborhood" />
<label for="sp_minprice">Min. Price</label>
<input name="sp_minprice" type="text" placeholder="Min Price" />
<!--
<select name="sp_minprice" id="sp_minprice" class="btn-block">
<option value="0">No Min</option>
<option value="25000">25,000</option>
<option value="50000">50,000</option>
<option value="75000">75,000</option>
</select>
-->
<label for="sp_maxprice">Max. Price</label>
<input name="sp_maxprice" type="text" placeholder="Max Price" />
<!--
<select name="sp_maxprice" id="sp_maxprice" class="btn-block">
<option value="50000000">No Max</option>
<option value="25000">25,000</option>
<option value="50000">50,000</option>
<option value="75000">75,000</option>
</select>
-->
<label for="sp_bedrooms">Bedrooms</label>
<input class="short" name="sp_bedrooms" type="text" placeholder="Beds" />
<!--
<select name="sp_bedrooms" id="sp_bedrooms" class="input-small btn-block">
<option value="">All</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4+</option>
</select>
-->
<label for="sp_bathrooms">Bathroom</label>
<input class="short" name="sp_bathrooms" type="text" placeholder="Baths" />
<!--
<select name="sp_bathrooms" id="sp_bathrooms" class="input-small btn-block">
<option value="">All</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4+</option>
</select>
-->
<div class="controls">
<input id="sp_search_submit" class="btn" type="submit" value="Search" />
</div>
</form>
CSS
form {
max-width: 100%;
margin: auto;
text-align: center;
}
input {
text-align: center;
padding: 1rem 1rem;
border-radius: .5rem;
border: 2px solid #ddd;
font-size: 1.3em;
max-width: 8em;
}
.controls { padding: 1em 0 0; }
#sp_search_submit {
background: #809eb6;
border: 0;
color: #fff;
text-transform: uppercase;
letter-spacing: .2rem;
}
input:focus { outline: 0; }
.short { max-width: 4em; }
label { display: none; }
It's a CSS problem. There is a z-index of -1 on a parent element.
See this style
.post-489 .et_pb_section:nth-child(1) {
z-index: -1!important;
}
It's references in the head of your page
<!-- Start CSSHero.org Dynamic CSS & Fonts Loading -->
<link rel="stylesheet" type="text/css" media="all" href="http://www.codytritter.com?wpcss_action=show_css" data-apply-prefixfree />
<!-- End CSSHero.org Dynamic CSS & Fonts Loading -->
i am trying to align html controls next to each other without giving huge space and I try to override the bootstrap .css but no luck.
here is my screen looks like:
I have created JSFiddle and also below is my html code.
JSFIDDLE
<div class="row">
<div class="col-xs-4">
<div class="form-group1">
<label class="col-xs-5 control-label" for="">Rows per page:</label>
<div class="col-xs-4">
<form action="/SystemAdmin" id="form_header_pager" method="post" name=
"form_header_pager">
<select class="form-control" data-val="true" data-val-number=
"The field PageSize must be a number." data-val-required=
"The PageSize field is required." id="PageSize" name=
"PageSizeSelect">
<option selected="selected" value="10">
10
</option>
<option value="25">
25
</option>
<option value="50">
50
</option>
<option value="ALL">
ALL
</option>
</select>
</form>
</div>
</div>
</div>
<div class="col-xs-4">
<div>
<div>
<b>Total records:</b> 0
</div>
</div>
</div>
<div class="col-xs-4">
<div class="form-group1">
<label class="col-xs-5 control-label" for="">Show Records:</label>
<div class="col-xs-7">
<form action="/SystemAdmin" id="form_header_show_records" method="post"
name="form_header_show_records">
<select class="form-control" id="ShowRecords" name="showrecords">
<option value="all">
Show All Records
</option>
<option value="invalid">
Show Invalid Records
</option>
<option value="valid">
Show Valid Records
</option>
</select>
</form>
</div>
</div>
</div>
</div>
The big spaces within your layout are caused from using the grid column widths. Bootstrap provides inline form element styling and it's recommended to use that instead of the grid columns.
The additional CSS adjustment I had to make was your totals area. Since it didn't have an input or select element, the vertical alignment was slightly off. If you had a row of inputs (as show in Bootstrap's documentation), you wouldn't need any additional CSS here.
You can view this corrected code snippet below. Please note that you must run it in "Full Page" mode to view it correctly. By default the form-inline tool only works in viewports greater than 768px.
.record-results {
display: inline-block;
margin-bottom: 3px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"/>
<div class="form-inline">
<div class="form-group">
<form action="/SystemAdmin" id="form_header_pager" method="post" name="form_header_pager">
<label for="PageSize">Rows per page:</label>
<select class="form-control" data-val="true" data-val-number="The field PageSize must be a number." data-val-required="The PageSize field is required." id="PageSize" name="PageSizeSelect">
<option selected="selected" value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="ALL">ALL</option>
</select>
</form>
</div>
<div class="form-group ">
<span class="record-results"><strong>Total records:</strong> 0</span>
</div>
<div class="form-group">
<form action="/SystemAdmin" id="form_header_show_records" method="post" name="form_header_show_records">
<label for="showrecords">Show Records:</label>
<select class="form-control" id="ShowRecords" name="showrecords">
<option value="all">Show All Records</option>
<option value="invalid">Show Invalid Records</option>
<option value="valid">Show Valid Records</option>
</select>
</form>
</div>
</div>
JSBIN
your layout is confused me. So I did another to achieve.
The key code:
<form class="form-inline">
<div class="form-group">
<label for="exampleInputName2">Rows per page:</label>
<select name="" id="" class="form-control">
<option value="1">test</option>
<option value="1">test</option>
<option value="1">test</option>
</select>
</div>
<div class="form-group">
<label for="exampleInputEmail2">Total records:</label>
<span class="text-danger">99</span>
</div>
<div class="form-group">
<label for="exampleInputName2">Show Records:</label>
<select name="" id="" class="form-control">
<option value="1">test</option>
<option value="1">test</option>
<option value="1">test</option>
</select>
</div>
</form>
<html>
<body>
<form name="orderform" action="order.php" method="POST">
<label>Username</label><br>
<input name="user" type="text" value="" size="10" maxlength="22">
<br>
<label>Items</label>
<div align="left">
<select name="mydropdown">
<option value="macbook">Macbook</option>
<option value="sony">Sony</option>
<option value="micromax">Micromax</option>
<option value="napolean">Napolean</option>
<option value="motorola">Motorola</option>
</select>
</div>
<label>Quantity</label>
<div align="left">
<select name="mydropdown">
<option value="quantity1">1</option>
<option value="quantity2">2</option>
<option value="quantity3">3</option>
<option value="quantity4">4</option>
<option value="quantity5">5</option>
</select>
</div>
<input name="Order" type="submit" value="Order">
</form>
<form name="orderform" action="addtocart.php" method="POST">
<input name="Cart" type="submit" value="Add to Cart">
</form>
</body>
</html>
after executing this code all output is in vertical form i just wanted to make it in a line.please give me a solution i am new in php.
Try this
<!doctype html>
<html>
<head>
<style type="text/css" media="screen">
form div {
display: inline-block;
}
</style>
</head>
<body>
<form name="orderform" action="order.php" method="POST">
<div>
<label>Username</label>
<input name="user" type="text" value="" size="10" maxlength="22">
</div>
<div align="left">
<label>Items</label>
<select name="mydropdown">
<option value="macbook">Macbook</option>
<option value="sony">Sony</option>
<option value="micromax">Micromax</option>
<option value="napolean">Napolean</option>
<option value="motorola">Motorola</option>
</select>
</div>
<div align="left">
<label>Quantity</label>
<select name="mydropdown">
<option value="quantity1">1</option>
<option value="quantity2">2</option>
<option value="quantity3">3</option>
<option value="quantity4">4</option>
<option value="quantity5">5</option>
</select>
</div>
<div>
<input name="Order" type="submit" value="Order">
</div>
<div>
<input name="Cart" type="submit" value="Add to Cart">
</div>
</form>
</body>
</html>
It would be easy to put it all on one line using CSS. You would just remove the default line breaking effects of some elements:
form, form div { display: inline }
form br { display: none }
To do the same in HTML requires modification of the HTML markup, of course. You just remove the div and br tags, but the forms require special treatment: the way to put two forms on one line in HTML is to put them in a table:
<html>
<body>
<table cellpadding=0 cellspacing=0>
<tr><td>
<form name="orderform" action="order.php" method="POST">
<label>Username</label>
<input name="user" type="text" value="" size="10" maxlength="22">
<label>Items</label>
<select name="mydropdown">
<option value="macbook">Macbook</option>
<option value="sony">Sony</option>
<option value="micromax">Micromax</option>
<option value="napolean">Napolean</option>
<option value="motorola">Motorola</option>
</select>
<label>Quantity</label>
<select name="mydropdown">
<option value="quantity1">1</option>
<option value="quantity2">2</option>
<option value="quantity3">3</option>
<option value="quantity4">4</option>
<option value="quantity5">5</option>
</select>
<input name="Order" type="submit" value="Order">
</form>
<td>
<form name="orderform" action="addtocart.php" method="POST">
<input name="Cart" type="submit" value="Add to Cart">
</form>
</table>
</body>
</html>