I'm trying to include a large image (a map) as background in a web page, with the ability to scroll to view the areas outside the current viewport. I'm using the CSS overflow property and its scroll attribute. 'Scroll' attribute on the CSS 'overflow' property fails. The borders appear on the right and bottom of the browser window, but without scrollbars. As a result it is not possible to scroll the HTML element. Desired behavior is functional scroll bars.
I tried switching the sequence of the CSS properties, understanding that the last one rules. No impact. Tried viewing in different browsers, to see if it's browser-specific. Fails equally in Firefox, Chrome, Chromium, and Safari. MDN docs indicate this should work.
...
<style type="text/css">
html {
background-image: url(art/GbMap.png);
background-size: 2000px 2100px;
overflow: scroll;
}
</style>
...
Expected: borders on the bottom and right with scrollbars that allow me to scroll the image.
Actual: borders on the bottom and right, but no scrollbars.
Related
See the frozen DOM state of the page in this Plunker.
The code should represent a modal with four tabs, of which the third tab content is open. Should look something like the image below (rendered in latest Chrome): three divs side-by-side which contain overflowing content and the divs are scrollable. On the bottom there's a div containing Plotting method text and a button. The same view is visible in Firefox as well.
What I see in latest Safari:
After disabling the style
height: 10px;
from .heatmap-multiple-variable-container
the rendered Safari content is:
notice how the third content div, which is scrolled way down, does not present all of its content (the Select all row) as it does in Chrome. Also the div containing Plotting method is not visible.
In Microsoft Edge, the div containing Plotting method is visible but the same scrolling problem as in Safari exists.
Any ideas on how to modify the Flexbox layout to display the menu in the same manner for all of the three browsers? I'm really stuck, so any pointers you can give me are appreciated.
Ok this was a hard one! Add this to your CSS and it should work. (tested in Safari)
body .multiple-variable-selection-columns-container {
height: calc(100% - 66px);
}
body .modal-menu .tab-content {
height: calc(100% - 57px);
}
body .modal-wide .modal-dialog .modal-content .modal-body {
height: calc(100% - 110px);
}
ng-include {
display: block;
}
You have added height: 100%; to elements who have neighbour elements with there own height. You have definitely to cleanup your markup, but the CSS above should work for the moment.
I have added the body to get a stronger selector to overwrite your code. I also added a default display style for ng-include tag, the browser doesn't know what kind of styles to use, so the tag has no hight and is hard to debug.
I hope I could help you.
The back story....
I'm creating a modal directive for AngularJS that should take any** content and display it centered in the page with a grey transparent background. Sounds like it should be simple. It was working fine until testing w/ IE9 which is the only browser we need to support. Its an in-house site. I have a fiddler working with it centered both vertically and horizontally, that probably could be cleaned up a little. I'm assuming that its going to work, I'm on a mac right now.
The modal's html needs to be in the footer which is fixed to the bottom of the page. So
So I have two questions.
1st- When I was setting up the grey transparent background found that I needed so set the position as relative. Why is this needed? fiddler
.dialogbox-wrapper{
z-index:1000;
display: table-cell;
vertical-align: middle;
/* When this isnt included this has the opacity */
position:relative;
}
2nd- We are using less and CSS3. Is there a cleaner way?
Here's what I need -
Before anyone suggests !doctype HTML, its there.
As to #1
For z-index to be honored, an element must have position of some kind. If position: relative is simply removed, then the default static position does not recognize the z-index: 1000 and so the gray box's z-index: 50 puts your "background" to the foreground.
As to #2
"Cleaner" can be so relative. Here is a modified version of your fiddle that centers it without the need for the min-width (which you expressed in your notations wanting to eliminate), by using display: inline-block with the container set to text-align: center (which is reset on the element itself). It also sets the <a> element for the "close" to display: block so that your width: 200px actually does something (an anchor is an inline element normally, which does not honor width). Of course, now 200px for the .row is driving the width of the modal display.
It all works in IE9 for me.
http://jsfiddle.net/qJKKC/2/
I've got a nav peeking out from the right-hand side of the screen. As it does, I use an :after CSS generated element to darken the main content. In other browsers, this works fine, but in IE10 the generated element overlays the scrollbar. In the above fiddle, push the bottom of the window up until a scrollbar is present, then click on the text and you'll see what I mean.
I'm using the .window element to prevent horizontal scrolling to the nav.
How can I prevent this element overlaying the scrollbar, or otherwise achieve the same effect?
I can't see the problem as I don't have IE10 but as a guess you could try adding a high positive number to the z-index on the nav element:
.nav {
z-index:999;
}
I'm doing some web development and for some reason on some of the pages the scrollbar on the right side of the window is transparent or white when using Chrome. I've looked through my css and I don't see any scrollbar styling set. The scrollbars look normal in firefox.
If it's because the page is so short that no scroll bar is required, but you still want it to show up, you can set the overflow-y CSS property to scroll on the html element of the page. For example:
html {
overflow: auto;
overflow-y: scroll;
}
In both Safari and Chrome, the placeholder attribute seems to add invisible width, causing horizontal scroll-bars and a flicker-like rendering when the window is re-sized horizontally.
overflow: hidden; can be applied to the parent element to curb the issue. However, it clips my form field focus effects.
Is there a way to use certain vendor prefixes values to prevent this such as ::-webkit-input-placeholder {} or some other way?
When the attribute is added to the form input, a horizontal scroll-bar flickers when re-sized horizontally on a webkit browser. Specifically, what style is triggering this behavior? And how do I prevent or override this behavior!?
Many input elements have default padding. When you state width: 100%, it causes the element to be width 100% + padding. To prevent the padding from increasing the width simply use box-sizing: border-box;
I looked at your site in Chrome and Safari, but it doesn’t seem to be having the issue you mentioned. However, your top image is overflowing to the top because you sat the overflow to hidden and you didn’t set a top-margin for your header. So, I went ahead and created that margin:
#header img {
margin-top: 50px;
}
and that solved the problem. I wish I could post an image.