-->

Material Design Lite hamburger menu not centered i

2020-07-10 09:21发布

问题:

I'm copying code directly from getmdl.io (the component page) and on all devices (multiple PCs, browsers, phones, etc) the hamburger menu is not centered in the header. I can't seem to isolate the menu icon in the css to realign it. All the component code on getmdl.io has the burger icon displayed correctly. Here is an example image. (I don't have enough reputation to directly link to the image.) http://i.imgur.com/e9HiCP5.jpg

here is the code in question

http://pastebin.com/Wgdt71Mv

回答1:

Looks like you need to add the proper HTML5 doctype to your markup to get things working properly. Try adding <!doctype html> to the very top of your HTML. That should fix it.

In addition to the doctype, we did have a slight height bug on the appbar causing it to be about 2px off-center. This has been addressed and will be out in the next release.