in Education by
I gave this CSS class to some input fields .searchField { display: inline-block; } This is their underlying HTML ...
Search For Results
However, despite the fact that there is enough horizontal screen real estate, one of them keeps wrapping to teh next line, as this Fiddle illustrates -- https://jsfiddle.net/3mwn14fk/ . How do I keep these items on one line (assuming there is enough browser width)? Note I also want to keep the DIV they are within vertically and horizontally centered. Edit: This is what I see in the Fiddle. This is on Firefox. Note the text fields are not on one line. Edit 2 Per Monica's Fiddle, this is what I see. Note that the first naem and last name are on one line, but the event text box is on the next line. I would like all three to be on the same line, even if the black box containing them has to expand JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Just to give you an alternative you could use flexbox to achieve what you want. Here's a quick demo: /* Just some basic CSS declarations to start with */ * { box-sizing: border-box; } html, body { margin: 0; min-width: 100%; min-height: 100%; } h4 { margin: 5px 0; /* Just to make the demo look nicer */ } #loginArea { border-radius: 25px; font-family: 'russo_oneregular'; font-size: 20px; padding: 20px; background-color: #CCCCCC; color: #ffffff; position: absolute; top: 50%; left: 50%; transform: translateX(-50%) translateY(-50%); display: block; width: 80%; /* You could use anything here, depending if you have a wrapping parent etc */ } #search-form { position: relative; display: flex; align-items: center; /* Not necessary but will center the items */ flex-direction: row; /* Not necessary but tells that they should be in a row */ justify-content: flex-start; /* Will align items to left on larger screens */ flex-wrap: wrap; /* Will allow the flex inputs to wrap on smaller screens */ } #search-form > * { /* You could give a class or element instead of asterix */ margin: 0 10px 5px 0; /* Just to make it look nices */ width: 25%; /* Width of text inputs, you could set them different from each other */ min-width: 100px; /* Min width to wrap elements when small screen */ flex: 1; } #search-form .search_button { max-height: 20px; flex: 0 0 20px; /* Keep the magnifying class proportioned/20px wide */ min-width: 0px; /* Do not use the min-width declared above */ margin: 0 0 5px 0; }

Search For Results

Run code snippetExpand snippet I set the login area to a width of 80% but you can alter this in any way you want of course. I set also the min-width of the inputs to 100 pixels - except for the last one - so that it will wrap nicely on smaller screens. I also set the max-width for the inputs so they will not grow infinitely and the search forms justify-content: flex-start; will align them to left on bigger screens. Also the support for flexbox on browsers can be improved with setting prefixes like -webkit- and -ms- etc to the CSS declarations. JSFiddle to play around with Browser support for flexbox

Related questions

0 votes
    what are the things that we should keep in mind while preparing presentation Select the correct answer from above options...
asked Dec 28, 2021 in Education by JackTerrance
0 votes
    b) List the things we should keep in mind while communicating orally. c) Raghav wants to update the changes in ... customise the TOC? Select the correct answer from above options...
asked Dec 1, 2021 in Education by JackTerrance
0 votes
    An _______________ allows users for accessing the web while blocking the trackers or agents that keep tracing the identity ... 2) extranet 3) complex network 4) anonymity network...
asked Dec 29, 2020 in Technology by JackTerrance
0 votes
    Suppose you have some subset of codes with you while working with the SVN and you need to move them from one SVN repo ... to another along with their history, how this can be done?...
asked Feb 18, 2021 in Technology by JackTerrance
0 votes
    Take from a pack of cards all the Aces, Kings, Queens and Jacks. Arrange them in a 4 × 4 square so that every ... and one card of each suit (Heart, Spade, Diamond, Club)....
asked Feb 11, 2021 in Education by JackTerrance
0 votes
    I've got the following html Title News 10. April 2011 First News 09. Feb. 2011 Second News With ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    I've successfully floated labels above form input fields when focused, but I'm stumped on how to keep ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 1, 2022 in Education by JackTerrance
0 votes
    A penetration tester must identify and keep in mind the ___________ & ___________ requirements of a firm while evaluating ... questions and answers pdf, mcq on Cyber Security pdf,...
asked Nov 3, 2021 in Education by JackTerrance
0 votes
    Basically I've managed to layout my DIV elements into a circle shape but I've not managed to work ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    Basically I've managed to layout my DIV elements into a circle shape but I've not managed to work ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    Basically I've managed to layout my DIV elements into a circle shape but I've not managed to work ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    Wordpress site. I want jquery or php, or any easy solution that will grab div from div id=content ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    Using Scanner, input name, class, div, roll number and marks in three subjects of a student. Calculate total ... total and average. Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
...