A
A
Andrey Khokhlov2014-06-04 07:56:51
css
Andrey Khokhlov, 2014-06-04 07:56:51

How to make a cross-browser menu with rubber blocks?

Task: to make a menu with rubber blocks and animation.

For clarity:
c5671745a45f417aace1a2ad0430043e.png

The left block contains menu items that can be of any width (depending on the text), but with the same padding.

In the right blog there is an input text, with focus on which the value of the menu item paddings decreases and the block with the input (and the input itself) increases.

I solved the problem as follows:
jsfiddle.net/andrhohlov/mD7Nd/1

But there is a cross-browser problem.

If the .b-search-form block has the "display: table" property, then the input in IE10 becomes 100% of the .b-global-nav width and extends far beyond the menu.
48865403809f4b53b67d0e1ecca8040a.png

If you do not specify this property, then we have a problem in Firefox - a fixed input'a size.
4e8ac301097644f3a59feabd9e50968e.PNG

In Chrome and Opera, everything is fine with any value of the property. Didn't check in Safari.

Requires IE9+ support

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Yatsenyuk, 2014-06-04
@spamforhope

Try playing with the display property . This may be suitable:
Chrome, Opera and Safari on the same engine - webkit, they display everything the same.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question