Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Form element not respecting CSS vertical alignment in Opera

I've inserted a Google Custom Search Engine form inside of a navigation bar but I just can't get it to center align in Opera. All browsers are respecting the vertical alignment perfectly (yes! even IE.. wow!).

You can check it out at www.micod.cat (the site's not in English but you can easily view the Search box in the menu bar, right). Opera is pushing the form input field flush against the top and that's incorrect.

Here's the CSS for that element:

#menu li.find form div {
   padding: 0;
   margin: 0;
   height: 50px;
   line-height: 50px;
   vertical-align: middle;
}

Any bright minds to offer some insight please? Thanks a lot!

like image 934
user706600 Avatar asked Oct 11 '22 20:10

user706600


1 Answers

The problem is the Doctype, changing it to a strict one or an HTML one fixes it e.g.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>

The XHTML transitional Doctype means Opera renders in "Almost Standards" mode, though quite why that would affect this I don't know, - Opera Doctype Switches

like image 157
clairesuzy Avatar answered Oct 14 '22 03:10

clairesuzy