html - Problems with CSS and styling input tags for a search bar -
The CSS code I'm working with here:
#navigation input # Search_bar {background: urls (images / searchbar pages) no-repeat; Border: None; Height: 20px; Width: 156px; Margin: 0; } #navigation input # submit {background: url (images / submit.png) no-repeat; Width: 30px; Height: 20px; Margin-left: -30px; Border: None; }
HTML:
& lt; Div id = "navigation" & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Home & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Services & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; About us & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Portfolio & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Contact us & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; Input id = "search_bar" type = "text" name = "search_bar" /> & Lt; Input id = "submit" type = "submit" name = "search_submit" value = "" /> & Lt; / Div & gt;
The submit button is never inline with the search bar, but at the base of the browser, above or below a small or large amount.
Example:
HTML -
CSS -
It looks like a vertical-alignment trouble. Try adding a display: inline-block; For both search field and submit button
Comments
Post a Comment