Why isn't min-width working for ie6? - html

I am coding exclusive ie6 css, wherein I am facing the problem. The footer does not take the min-width value whereas it accepts the fixed width value. I am using the repeat-x for an image and assigning a min-width value to it. The same thing I did with header div and it works perfectly fine. For example here is my code.
Header HTML which I have used for the same purpose.
<div id="header">
<!-- top-menu -->
<div id="top-menu">
<div id="left-logo">
<img src="img/logo-left.png" alt="BhatkalNews" />
</div>
<div id="navigation">
<ul>
<li class="contact"><img src="img/contact.png" alt="contact" /></li>
<li class="photo"><img src="img/photo.png" alt="photo"/></li>
<li class="video"><img src="img/video.png" alt="video" /></li>
</ul>
</div>
<div id="right-logo">
<img src="img/logo-right.png" alt="BhatkalNews" />
</div>
</div>
</div>
And here is the css I have used.
#header {
min-width: 1040px;
height: 111px;
background: url('../img/header-bg.jpg') repeat-x;
}
and for the same purpose the footer code is.
<div id="footer">
</div>
and the css
#footer {
min-width:1040px;
background:#36240A url('../img/footer.jpg') repeat-x;
height:291px;
}
Why isn't footer assigning the min-width?

Min-width doesn't work with IE6 - no surprises there as IE6 is terrible.
There are some workarounds, here is one:
{width:90%; min-width:1040px}
Basically, use width with a percentage - you'll have to experiment on the percentage depending on what you are trying to achieve.

IE6(not even 7) does not support min-width.
try expresssions like
width: expression( document.body.clientWidth < 1040 ? "1040px" : "auto" );

Unfortunately min-width simply doesn't work in IE6. There's some javascript based hacks that you can try though if you absolutely need to use min-width.

min-width and max-width are not supported by ie6.
Here is a workaround that I found with a quick google.
Though I haven't tested it, it seems to be sound.

This only works in IE:
#footer{
width:expression
(document.body.clientWidth < 1040? "1040px": "auto")
}

Try _width: 1040px; along with min-width: 1040px;

well to be frank none of the solution worked satisfactorily for me. and after doing a workaround i came up with this solution.
<div id="footer">
<div id="footer-content">
</div>
</div>
i defined the footer. and wrapped footer-content inside it and assigned width of 990px as i wanted the content to be wrapped within 940px i gave a padding of 50px; to the left. here is the css i used.
/*footer*/
#footer {
height: 291px;
background: url('../img/footer.jpg') repeat-x;
}
#footer-content {
margin:0 auto!important;
width: 990px;
height:291px;
padding-left:50px;
}
this works perfectly fine for me and the div's positions perfectly fine even if i am resizing. thank you for all the help guys. :)

Since you're coding exclusively for IE6, it be much more simple just to use:
width: 1040px;
IE6 doesn't recognize min-width, but treats width incorrectly, as if it was min-width.
(If it's not exclusively for IE6, you can use a hack, like the _width they already suggested you... or, even better, use conditional comments).

I've explained how to use min-width or min-height in IE6 over here: Min width in window resizing

Related

ignore a div while zooming in chrome

I would like to zoom in my react app(coreUI) with 'ctrl+PLUS' in chrome. but I want to ignore the height of the header and footer while zooming, is that even possible?
//html
<div className="ignore-zoom">
<h1>title</h1>
<div>
//css
.ignore-zoom{
width: 100%;
height: 50px fixed !important;
}
I found this https://css-tricks.com/zooming-squishes/ you can try to use "em" base media query to try to solve this.

max-width not working for IE 11

I´m very new designer and created my own WordPress theme and it works as expected on FireFox, Chrome and Opera. The problem arrives with InternetExplorer (i´m using Windows 7 with IE 11).
Seems that InternetExplorer 11 don't understand the max-width CSS. I have this CSS:
.vi-container {
margin: 0 auto;
position: relative;
width: 100%;
}
.vi-content {
margin: 0 auto;
max-width: 1200px;
overflow: hidden;
}
The HTMl code is something like:
<div class="vi-container">
<header class="vi-header">Header stuff</header>
<main class="vi-content" itemtype="http://schema.org/Blog" itemprop="mainContentOfPage" itemscope="" role="main">
<article class="post-content-wrap" itemtype="http://schema.org/BlogPosting" itemprop="blogPost" itemscope=""></article>
<!-- more articles with contents -->
<aside class="vi-sidebar" itemtype="http://schema.org/WPSideBar" itemscope="" role="complementary"></aside>
</main>
</div>
The max-width 1200px is totaly ignored by InternetExplorer. You can see it in live loading my webpage in IE and other browser to compare. For example: http://www.vozidea.com/limpia-la-base-de-datos-wordpress-con-wp-sweep
And here an example JSfiddle: http://jsfiddle.net/z4s01yxz/
I found other articles into StackOverflow about max-width issues on IE, but couldn't achieve a fix bymyself, that's why i´m requesting help. Hope that someone can give me a hand with this, thanks in advance.
The actual problem is that in InternetExplorer the webpage expands to fill all the width because max-width is ignored. You can check this image to see the difference: i.imgur.com/kGr8wk1.jpg
P.S: Sorry for my bad english.
I think your problem is not coming from max-width but from main element...
The main element is not fully supported by IE11 (source).
2 solutions :
Change your <main> element to a <div>. Demo : http://jsfiddle.net/z4s01yxz/2/
Add main { display: block; } to your CSS. Demo : http://jsfiddle.net/z4s01yxz/1/
I have a condition, in my case, I have image with parent divs in table layout. My condition was to make the image center center and if big image, then max-width to 100%. So, to make the max-width work I had the code below:
.cmp-logo{
diplay:table;
table-layout:fixed;
width:100%;
height:100%;
}
.td{
display:table-cell;
vertical-align:middle;
}
.td img{
display:block;
width:auto;
height:auto;
max-width:100%;
max-height:260px;
margin:0 auto;
}
In above solution, if you remove table-layout:fixed, the max-width does not work in IE11 and below.
use this,
display: -ms-grid;
-ms-grid-columns: max-content;

how to make a div to take up the remaining height using css?

I Have the following html:
<html>
<body>
<div id="header" style="height:55px;">
<div id="menu" style="height:85px;">
<div id="container" style="height:100%;">
<body>
</html>
but container div is not taking the full height.its takes the height to cover the content within it.
You can use calc() to achieve that
#container {
height: calc(100% - 140px);
background: #f00;
}
Demo
Here, I am adding up 55px of #header and 85px of #menu which sums up to 140px and than we deduct that from 100%. Also, avoid using inline CSS. Just make sure you set the parents height to 100% as well else the solution will fail.
html, body {
height: 100%;
}
The browser support is pretty decent as well.
Credits for support chart : Mozilla Developer Network
HTML tags must be closed.
For example,
<div> must be followed by </div> there a few exceptions to this such as the <input /> and <img /> tags which are considered self closing.
Here is a slightly better version of your code: http://jsbin.com/uyIwERE/4/edit

How can I change this div layout so that the float works in IE?

<div class="sectiuni_home_box" style="width: 626px; padding-left: 0px;">
<div class="sectiuni_home_box_t" style="border-left: 0; width: 618px;">
<div class="sectiuni_home_box_v" style=" width: 616px;">
<div align="left" style="width: 1px; border: 0; border-left: 1px solid #c3c3c3; float:left; height: 100%; padding: 0; vertical-align: middle;"></div>
<div id="actiuni" name="actiuni">
<table style="border: 0;"></table>
<div id="lista_actiuni" name="lista_actiuni">
<div id="actiuni_scroll" class="scroll" style="width: 100%; height: 428px; overflow-x: auto; overflow-y: scroll;">
</div>
</div>
</div>
</div>
</div>
This is the layout i'm talking about. the only div that has the float is suppsoed to be to the left of #actiuni and #lista_actiuni. Looks exactly like that in Firefox, but IE puts #lista_actiuni below everything else. It puts the float div to the left, the table to the right of it starting at the top but then when it's time to place #lista_actiuni it drops it all the way down to where the floaty div ends. To make it worse it sometimes corrects itself and places everything nicely, only to be broken again when I switch pages or refresh.
Any ideas on what could be causing it?
I've scrapped together a demonstration using code from the page. Closest thing I can get. The problem is that in the example it looks wrong both in ie and in Firefox but on the actual website it works corectly.
edit: edited the jsfiddle, replaced with a version that works properly in Firefox yet fails in IE.
update: it seems removing the #actiuni_scroll div and the table within it and leaving only the bare data i've managed to make it display properly so my guess is that's where the problem is
update 2: I've fixed the problem by removing the width attribute from the #actiuni_scroll div. It seems firefox know how to calculate the 100% width to include the elements floated to its left but IE doesn't.
Completely off the top of my head (without anything visual to play with) I reckon you could try adding overflow:hidden to the .sectiuni_home_box_v div.
Floats need to be cleared, it does not look like you are doing this.
HTML
<div class="sectiuni_home_box_v">
<!-- IE6 has problems with more than 1 css rule & IE7 does not recognise psudeo's SO -->
<br class=clearfix />
</div>
CSS
.clearfix{
clear:both;
visibility: hidden;
height:0;
*zoom:1;
}
NOTE: IE7 will apply double margin to some elements and in some cases
double padding, you can do a quick fix with a css rule {
*display:inline;*zoom:1; }
I've fixed the problem by removing the width attribute from the #actiuni_scroll div. It seems firefox know how to calculate the 100% width to include the elements floated to its left but IE doesn't.

Continuous layout with DIVs

<div id="top">
*height: auto;
min-height: 100%;*
<div id="content">
*min-height: 500px;*
</div>
<div id="middle">
*css ???*
</div>
</div>
<div id="footer">
</div>
This code works nice when the screen size is normal. But in full screen mode, the footer goes to the bottom of the page (wanted behaviour) but the ''middle'' div must increase its height to get the footer. I mean, the 3 elements (content, middle and footer) must be continuous.
Which css rules should I use to do this behaviour?
Thanks in advance!
UPDATE.
I've used a couple css rules and works, but don't in IE8 (works in IE9, Chrome, FF3 e FF4). The relevant CSS is:
Top{ height: auto; }
Content{ min-height: 100%; }
Middle{ overflow: auto; padding-bottom: 130px; }
Footer{ clear: both; height: 130px; margin-top: -130px; position: relative; }
You might try CSS Media Queries with max or min-height. Examples here: http://ie.microsoft.com/testdrive/HTML5/CSS3MediaQueries/Default.html
and documentation here: http://www.w3.org/TR/css3-mediaqueries/
height:100%; should be all that is needed to make it take up the available space.
The Bad News: To be honest, mate, I don't think this is possible with this exact specification. It would take some very clever css at any rate. However, tables would work nicely. I'm completely against the idea, but if this design requirement is a must, then perhaps you should go the route.
The Good News: Depending on why it is you need them to be fluid, we could maybe give the desired effect. If it's just for backgrounds to match up, we could probably do that. Update your post with more information and I'll (hopefully) update mine with an answer.