How to display inline input in li?
Tags: html,css
Problem :
HTML:
<div id="options">
<ul>
<li>
<label for="input_color">Input Color</label>
<input type="text" id="input_color">
</li>
<li>
<label for="output_color">Output Color</label>
<input type="text" id="output_color">
</li>
<li>
<label for="pixels">Pixels to the left</label>
<input type="text" id="pixels">
</li>
<li>
<label for="pixels">Speed (in second)</label>
<input type="text" value="0.02" id="speed">
</li>
<li>
<input type="submit" value="Reset" class="submit">
</li>
</ul>
</div>
CSS:
div#options ul, div#options li{
margin:0;
padding:0;
list-style:none;
}
div#options li{
clear: both;
list-style:none;
padding-bottom:30px;
white-space: nowrap;
}
div#options input{
float:left;
width: 50%;
}
div#options label{
float:left;
width: 50%;
}
I need to display input next to the label, but it always appears under it - how to fix it?
Solution :
Remove the padding and margin and borders from your inputs and labels, or make them both less than 50% wide.
They can't both fit side-by-side, the box model will make (at least the <input>
) wider than 50%: The space it occupies will be 50% the width of its container, plus its padding, plus its border.
CSS Howto..
The img tag is okay. The center tag is obsolete since about 1867. But you can easily use text-align: center as a style on the parent element of the logo....
You'll have to set dimensions on the a tag, and set it to display: block;. .login { background: url(../img/user.png) no-repeat 6px center; width: 100px; height: 100px; display: block; } Of...
You can do following way using JQuery. It will set initial value of right. $('.myclass').css({ 'right' : 'initial' }); .myclass{ position:fixed; right:0px; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="myclass"> test </div> ...
To be a true working blog, the other answers would have you dynamically create css and have a class or id for each date you wanted displayed. It would be...
While the answer to add float: left; certainly works, here is an option that uses flexbox. The reason I prefer flexbox is because it can be easier aligned correctly. .summarize...
The content property only works on the :after and :before psuedo classes, e.g. try: .notice { color:red; } .notice:after{ content: "information below are instructions for this method for this page";...
This works fine, have a look here #horizontal-style li { display: table-cell; vertical-align:middle; height:auto; padding:1%; background:#ebebec; } #horizontal-style li:hover{ background-color:#acce39; } ...
You should move the required span outside of the input-group div. <div class="col-md-10"> <span class="help-block" ng-show="addressForm.street.$invalid && !addressForm.street.$pristine">Required</span> <div class="input-group"> <input type="text" placeholder="Street" name="street"...
You could use the .get() method, as documented: Retrieve one of the elements matched by the jQuery object. $(".contact-form form").get(0) This gives you the DOM element. If instead you want...
The problem is you have #contact_section floated right on your main CSS so it will always align right. Try setting float:none; on both your divs #details_sections and #contact_section in your...
As long as x and y are known, you can do it by setting min-height and min-width on the element that contains your flash object: <body> <div id="flastObj"> flash object...
Use transform for that to the child div and it will work! position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); snippet below: .mainDiv { height:500px; position: relative; } .mainDiv...
Take a look at position; in this case position: fixed; bottom: 0; https://css-tricks.com/absolute-relative-fixed-positioining-how-do-they-differ/ #lowerleft { margin-bottom: 1px; margin-left : 1px; width: 200px; height: 200px; background-color: red; color: green; position: fixed;...
first take the style="width: 50%; float:left;" element out and add this to your css file: .blogpage_search { width: 50%; float: left; margin-top: 7px; } @media screen and (max-width: 600px) {...
Check the sample design and code with result, is this you want? HTML: <div class="menu-container"> <a class="menu-item" href="#">Menu 1</a> <a class="menu-item" href="#">Menu 2</a> <a class="menu-item" href="#">Menu 3</a> <a class="menu-item" href="#">Menu...
You need JavaScript. objDiv.scrollTop = objDiv.scrollHeight Unless the content is in an iframe. In which case you could make the url of the iframe "page.php#bottom" and add <div id="bottom"></div>...
You will need to absolutely position the .flag element and then position it using the top and the right properties, like this: .flag { width: 0; height: 0; border-left: 80px...
The effects take precedence in the order you place them, so if you put them like this, it should work input[type=text], textarea { -webkit-transition: all 0.30s ease-in-out; -moz-transition: all 0.30s...
Edit, you can use: box-shadow: 0 5px red; This shows both techniques being used on one DIV: <div id="square" style="height: 50px; width: 50px; border-left: 5px solid black; border-top: 5px solid...
Two changes I would recommend Add the below Jquery code to add delay: jQuery('div.dropdown').hover(function() { jQuery(this).find('.dropdown-menu').stop(true, true).delay(200).fadeIn(500); }, function() { jQuery(this).find('.dropdown-menu').stop(true, true).delay(200).fadeOut(500); }); Remove the css /.dropdown:hover...
You can create such effect with the help of javascript: document.addEventListener('DOMContentLoaded', function() { var generateBoxesAndAnimate = function(where, boxes) { for (var i = 1; i <= boxes; i++) { var...
Instead of -ms-box, try this: body { display:-ms-flexbox; -ms-flex-pack:center; -ms-flex-align:center; } This works for IE10+....
You may start with Titanium for desktop dev. Also you may have a look at Chromium Embedded Framework. It's basically a web browser control based on chromium. It's written in...
What he's doing is hiding a textbox off-screen. The actual command line is just an element styled to have 1 line's worth of height. When you click this command line,...
When multiple classes are specified with a space, it applies both of those classes to the element. Therefore if you specify div.even AND/OR div.last it will use them....
One of the most important things you can do to ensure site looks close enough is to write standards compliant code for the doctype you have chosen, and validate that...
Have you considered blockUI for this? 8k before GZip, this is all it does, shouldn't give you any trouble with other scripts. The main benefit for me is it takes...
You can do something like this: .flex { display: flex; flex-direction: row; flex-wrap: wrap; } .flex > div { flex: 1 0 50%; } .flex > div:first-child { flex: 0...
Did some optimisation, toggling an additional sticky class. Checked on Firefox with smoothscroll and a variety of padding-margin and seems to respond to the exact positions : Demo .sticky {...
The background image isn't showing becase the nav-top div hasn't got a height or any content inside of it. Please check this fiddle: https://jsfiddle.net/phq6q30n/ I've simply added a height to...