Bootstrap responsive image in table fails in IE11 - image

I have a table cell that includes an image that should be 50% of the cell's width.
The code works in Chrome, Firefox, and Edge, but in IE11 instead of taking on 50% of the cell's width, large images just take on 50% of their native size.
Here is a fiddle using a 800px wide image. Works fine except in IE11, where the image displays as 400px wide instead of responsive:
https://jsfiddle.net/43Tesseracts/9knqerj7/4/
Here is the relevant html with bootstrap:
<td>
<img src="http://hdwallpaperbackgrounds.net/wp-content/uploads/2016/12/Images-2.jpg"
style="max-width:50%;"
>
The image beside me should appear 50% of the cell, not 50% of it's native size. WOorks in Chrome, FF, Edge, but NOT IE 11
</td>
There appear to be many similar issues on SE, but they are all much older, or use an older version of Bootstrap. I'm using Bootstrap 3.3.7

there is no need for extra div's. you can set the following css property on the table element:
table{
table-layout: fixed;
}
i updated your fiddle with a working example:
https://jsfiddle.net/9knqerj7/10/
(in addition, i changed the img to be a block element and float left, but that is not required for the responsiveness - just looks better IMHO)

You could solve this issue using divs like i did here:
<td>
<div style="display: flex;">
<div style="width: 50%">
<img src="http://hdwallpaperbackgrounds.net/wp-content/uploads/2016/12/Images-2.jpg" style="width: 100%">
</div>
<div style="width: 50%">
THe image beside me should appear 50% of the cell, not 50% of it's native size. WOorks in Chrome, FF, Edge, but NOT IE 11
</div>
</div>
</td>
Working solution: https://jsfiddle.net/9knqerj7/8/

Related

Twitter Bootstrap: Image positioning

I am customizing my website using Twitter Bootstrap. I am trying to insert an image positioned as the top layer, is located slightly "outside of the container", and can responsively resize while staying proportionate / in relation to the other elements. I would like to use position: relative, but the image seems forced into a box within the container. When I use position: absolute, the image displays correctly at first on my web browser, but it does not behave as intended when the screen is resized.
Can anyone help me figure out a good solution to this issue?
HTML: I do not have the image contained within it's own , but is still located within the overall . Here's the code:
<img src="images/hero-babee.png" alt="Babee blowing bubbles." id="babee-bubbles">
CSS: Here's my custom css.
img#babee-bubbles {
z-index: 100;
position: relative;
top: 51%;
left: 7.5%;
}
I'd appreciate any help finding a solution and/or help with my code / syntax. Thanks in advance.
To design responsive website using bootstrap you can use bootstrap layout.
Fluid layout has class "row-fluid" and you can specify width in using class as span.
this structure will be responsive. to test it just resize your browser window.
<div class="row-fluid">
<div class="span2">
<img>....</img>
......
</div>
<div class="span2">
</div>
......
</div>
Bootstrap devide screen size in 12 part. we can use that part by giving
class="span*"
* is no of part.

graph layout in IE rendered wrong, Chrome works fine

first of all here is the link to jsfiddle: http://jsfiddle.net/HotFrost/RnNX3/6/
you can see that in chrome the graph layout inside the svg element, panned and zoomed ok. Whereas for IE (v9.0) it totally disregards the borders.
basically for this simple layout:
<div id="wrapper">
<div id="content-col"> graph
<div id="graphwidget_graphContainer" style="border: 4px solid purple;" ></div>
</div>
<div id="right-col"> menu </div>
</div>
IE and Chrome render graph differently.
I have tried to use different settings for width/height/remove them. I have tried to replace the divs with table cells.. Still same problem - in IE graph nodes are rendered above the svg element and then (when panned/zoomed) also go over the svg element borders.
Anyone can give some ideas how to fix it?
Thanks in advance!
HF

Nivo 7 JQuery Slider Compressing by about 15% after first image

I would really appreciate some help with a problem I am having with the Nivo 7 JQuery image slider.
-My website is responsive and I have separate stylesheets for phone and desktop
-The slider works beautifully on the phone version and the problem occurs on the desktop version of my site
*Problem:*Slider compresses by about 15% after the first image, and stays this way throughout all other images, even when it hits the first image again. The images are all the same dimensions (I have checked numerous times). It's not a sizing problem, the slider simply covers up the bottom 15% of the images after the first image that appears. I have copied all of the code and attached the relevant stylsheets as directed on the nivo 7 site.
What I don't understand is that it works perfectly in my the phone version of my site, but not the desktop. The only difference between phone and desktop is the layout. On the desktop, I have put a div wrapper around the slider to limit the width to 59% and height as auto. The #home1 section simply states that the width is 100%. Below is the code:
<div id="homeWrapper">
<section id="home1">
<div class="slider-wrapper theme-light">
<div id="slider" class="nivoSlider">
<img src="pictures/home/MindBodySoulCafe.jpg" width="470" height="303" alt="Mind, Body, Soul project Cafe perspective">
<img src="pictures/home/MindBodySoulCAD.jpg" width="470" height="303" alt="floor plan of Mind, Body & Soul">
<img src="pictures/home/barkmaterials.jpg" width="470" height="303" alt="Materials used for Bark Media Project">
<img src="pictures/home/modelstairs.jpg" width="470" height="303" alt="Construction model for staircase">
</div>
</div>
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider({
effect: 'slideInLeft',
pauseTime: 4000,
pauseOnHover: true,
startSlide: 0,
});
});
</script>
</section>
</div>
Unfortunately I don't have access to the css files at this time.

Absolute positioning works fine in Chrome and IE, it doesn't in FF

I am trying to set the position of a div within a table cell (with a relative position) to absolute and it works great in Chrome and IE, but in FF it seems as if it's just positioned absolute in relation to the entire body.
I'm trying to get my div to display in the top left of the cell (the link is just used to position another element in my code, but that should be positioned in the upper right of the cell). However in FF the div is displayed in the top left of the entire screen and the (element positioned by the) link in the top right of the entire screen.
Here's the relevant code:
<TD ID="EVENT" style="position:relative;">
<div id="detail" style="position:absolute;top:0;left:0;width:100%;z-index:10;">
content
</div>
</TD>
I'm not sure if this is relevant to the problem, but you're missing a quote mark in your table cell:
<TD ID="EVENT style="position:relative;">
Should read:
<TD ID="EVENT" style="position:relative;">
That sort of thing has caused problems for me in the past, although if it's ok in other browsers maybe that isn't causing the problem.
EDIT: Try using a container div inside the table cell.
<TD ID="EVENT">
<div id="container" style="position:relative;">
<div id="detail" style="position:absolute;top:0;left:0;width:100%;z-index:10;">
content
</div>
</div>
</TD>

Does MVC3 WebGrid support horizontal scrollbars?

I have a record set that is quite wide (about 25-30 cols)...does MVC3 WebGrid support horizontal scrollbars (or can I house the grid in a html tag/control)?
Never realised about the WebGrid, so had to play with it to help on this one.
Basically, if you put the webgrid inside a div with an overflow set, then it seems to work fine.
I tested it on mine with the following code (I just shrank the test div to simulate small screen/many rows (was to lazy to create loads of col/properties, lol.
<div class="test" style="overflow: scroll; width: 150px">
<div style="width: 1000px">
#grid.GetHtml()
</div>
</div>

Resources