Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

no line break between button and form

Tags:

How do I get a button and a form element in the same line without a linebreak happening? thank you very much!

  <button>ask question</button> <form action="/search" method="get">     <input type="text" name="q" value="{SearchQuery}"/>     <input type="submit" value="Search"/>     </form> 
like image 325
Roland Avatar asked Feb 02 '12 17:02

Roland


People also ask

How do I enable line breaks?

Press ALT+ENTER to insert the line break.

How do I make text not break to the next line?

If you want to prevent the text from wrapping, you can apply white-space: nowrap; Notice in HTML code example at the top of this article, there are actually two line breaks, one before the line of text and one after, which allow the text to be on its own line (in the code).

How do you force a line break in HTML?

To do a line break in HTML, use the <br> tag. Simply place the tag wherever you want to force a line break. Since an HTML line break is an empty element, there's no closing tag.

How do you line break without br?

A line break can be added to HTML elements without having to utilize a break return <br> by using pseudo-elements. Pseudo-elements are used to style a specific part of an element. Here we will use ::after to style an HTML element to add a line break.


1 Answers

Use this CSS style: style="display: inline;" on your form.

<form action="/search" method="get" style="display: inline;"> 

Here's a demo on JSBin.

like image 86
p.campbell Avatar answered Oct 09 '22 10:10

p.campbell