For now, I tested my web application style on Chrome, FF, IE9, IE10, IE11, and Edge.
It all works as I expected except on IE10 and IE11.
I have common.css file that works for Chrome, FF, Edge.
Then I made copy of it and renamed it commonIE9.css.
Then in my layout.jspx, I applied it like following:
<spring:url var="css_common" value="/resources/css/common.css"></spring:url>
<spring:url var="css_common_ie9" value="/resources/css/commonIE9.css"></spring:url>
(SKIP)
<link rel="stylesheet" href="${css_common}"/>
<!--[if IE 9]>
<link rel="stylesheet" href="${css_common_ie9}"/>
<![endif]-->
I used those ASCII codes as comment symbol. Credit to Mr. Colt from this post
So, I succeed to make it looks same in IE9 by changing value of width of couple items.
However, IE 10 and 11 does not support conditional comment.
I tried some hacks like
(-ms-high-contrast: active), (-ms-high-contrast: none)
but I have to apply different value per screen resolution like following:
@media only screen and (min-width: 1600px) {
.header {overflow:hidden;width:100%;margin:0 auto;}
.header .accTitle , .header .menu , .header .menuBtn {float: left;}
.header .accTitle {width:270px;padding:10px;} .header .menu {width:1200px;} .header .menuBtn {width:10%;padding:5px 0;}
.header .accTitle h2 {color:#2E75B6; font-size: 1.3em}
.header .accTitle strong {font-size: 1.1em}
(SKIP)
So I am not sure I can use the hack above because it looks like I cannot differ its width condition.
I saw reset.css and tried it. It made IE10/11 and last of them look same by reset all styles that I set, so I do not want to use it, or at least to figure out how to keep my css.
My screens look like these
Chrome:
FF:
IE9:
IE10:
EDIT
I did change like following:
layout.jspx
<spring:url var="js_test" value="/resources/js/test.js"></spring:url>
<script type="text/javascript" src="${js_test}"><jsp:text /></script>
test.js
var b = document.documentElement;
b.setAttribute('data-useragent', navigator.userAgent);
common.css
.noticeSearchButton { width: 100px; padding: 6px 0 0 100px; }
html[data-useragent*='MSIE 10.0'] .noticeSearchButton { width: 100px; padding: 6px 0 0 80px; }
I created new js file then added user agent like Arsen Babajanyan said.
Then in css, copy the element I have to differ depends on browser, and added html[data-useragent*='MSIE 10.0'] in front of it.
FYI, for IE 11, you should use html[data-useragent*='rv:11.0'].
Thank you for helping today guys.