CSS issue, when filling in a form the header goes up

断了今生、忘了曾经 提交于 2019-12-02 09:29:05

I think the solution is along these lines:

Set .header-wrap to have overflow:visible (well, remove overflow hidden!) - this will mean you have to slice those character graphics to have flat bottoms.

Then, change .tooltip-wrap to be position:absolute;z-index:2; (not fixed).

I also noticed that you have the placeholder polyfill in your head. This means you could use that attribute on the input rather than value; like so:

<input type="text" name="user_login" placeholder="Username">

Very cute site!

Very strange bug, and I can't explain what's going on. But it is related to your div.header-navigation.back. If you remove that, the behaviour disappears.

As far as I can tell, you are only using that element for your background image, so it's not a good idea to include it in the markup anyway. If you amend your .site-header you can achieve the same effect without the extra div:

.site-header {
   background: #0894ff url('http://frenchegg.com/images/backmenu.png') 50% 20px no-repeat;
   background: url('http://frenchegg.com/images/backmenu.png') 50% 20px no-repeat,
               linear-gradient(to bottom, rgba(255,255,255,0.1) 0%,rgba(255,255,255,0) 100%);
}

I couldn't quite work out what you're trying to achieve with your gradient, but the idea would be to provide multiple backgrounds for those browsers that support them, with a fallback to a solid colour.

Change the line-height of the input box - fixes the issue.

HTML to change:

<input type="text" id="text-user" name="user_login" value="Username" style="
    line-height: 15px;
">

CSS:

#text-user{
    line-height: 15px;
}

The reason is because the line-height of the input was much smaller without text, than it was with text. So when you typed something into the box, the line-height expanded which is what caused the header to be pushed up.

Edit

I see you're having no luck with the code, so do these two more things and you're sure to be up and running - it's working here for me.

Remove the following from .site-header:

padding: 2em 0;

Next, change the row style to look like this:

.row{ 
margin: 0 auto; 
padding: 0 30px; 
width: 1171px; 
height: 137px; 
}
DiederikEEn

You could give it a z-index instead of a fixed position, and give it an absolute position.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!