I am trying to create a header that has 3 columns (fixed - liquid - liquid) in my header section in < Code> ASP.NET MVC4 layout templates and I do not get much to work with IE 6+, Chrome, FF, etc.
Especially I need to see it
| -------------------------------------- | | Cover | | | --------- | | ---------- | | --------- | | | | Left | | Title | | Right | | | | --------- | | ---------- | | --------- | | | -------------------------------------- | Hold (to support IE6 and IE7 on one side) is that I need some wrapping when the window falls below 500px; To see something like this, this wrapping needs to be done only with those browsers which can support media queries. (I.e. for IE and LT; 9, squash while resizing 'title' in the example given above)
| ---------------- ---------------------- | | Header-cover | | | --------- | | --------- | | | | Left | | Right | | | | --------- | | --------- | | | | | | ---------------------------------- | | | | Title | | | | ---------------------------------- | | | -------------------------------------- | Here is the CSS that I have yet received
.content-wrapper {margin: 0 auto; Max-width: 1140px; } .header-wrapper {text-align: center; Vertical-alignment: text-down; } .header-left-box {float: left; Width: 160px; } .header-right-box {float: right; Margins: Auto; } .header-center-box {min-width: 200px; Background: None; Margins: Auto; Width: 50%; Padding: 4px; } .site-logo {background-image: url ('/ content / picture / logo.png'); Repeat Background: No Repetition; Background-position: top left; Display area; Width: 130px; Height: 80px; Margin-down: 5px; } And here is the relevant piece of MVC4 template
In addition to Jason's reply, for browser-specific coding or stylesheet, you have JavaScript enabled in addition to IE Can use for other browsers.
if (navigator.userAgent.toLowerCase (). IndexOf ('chrome')! = -1) {document.write ('& lt; link rel = "stylesheet" type = "text / Css "href =" style-ch.css "media =" all "/> gt; '); } simply & lt ;! - If [IE 6]> gt; & Lt ;! [Endif] - & gt; , it will run some code (like) in the example above, load Chrome-specific stylesheet) only when the browser used is specified. Of course you can also specify the browser version, such as: .indexOf ('chrome 11') Make sure that this code is The declaration has been declared to declare the regular / cross-arms stylesheet (s), or it will not work. I can not see why you will be bothered with optimization for IE6 and IE7 because they are really old. But this is your personal choice :)
No comments:
Post a Comment