So I added background image to an element for mobile devices in css, a regular png image to a div, positioned them absolute and thats it. However on iPhones and iPads it displays horribly, the image is darker, doesnt stay where it should on scroll (it moves, disappears, reappears...).
Screenshot from iPhone:
Screenshot from Android:
You can see that on first image it is very very different for some reason.
CSS:
padding: 0 !important;
position: absolute;
left: 10px;
width: 25px;
height: 37px;
background: url('../../Content/emerge-tiles/Images/left-opacity.png');
Related
I am using the default Lightbox2 for my website. When clicking an image, the Lightbox works perfectly except that the box (along with the darkened background) appear at the top of the page, rather than in it's scroll position. This only happens on the iPad. Is there something to adjust in the lightbox.css that I am missing?
Thank you in advance!
use this css to dark background,give fixed position using css also make top, left,right, bottom to 0 so it fits to screen and content inner to it will scroll using overflow auto css
position: fixed;
z-index: 999;
/* padding-top: 100px; */
left: 0;
top: 0;
bottom:0;
right:0;
overflow: auto;
I have a navigation menu in one div and there's a background image in other div which is set to absolute because it has to be in some a bit different position of the website. Now that image is transparent PNG and it blocks clicking the last link in the navigation because that image is technically on top of that link (visually not).
So I set z-index: 1 to menu and that fixed the problem only on Firefox, the link becomes clickable. It doesn't work on Chrome, Opera and IE though.
What could be the problem?
There's a screenshot, as you can see that girl image is transparent and when selected it shows that it technically is over that Contact us link and it somehow blocks it:
http://i.stack.imgur.com/O4rEV.jpg
The menu and the image are not in the same parent div.
#the-menu {
margin: 17px 0 0 17px;
z-index: 1;
}
#the-img {
background: url("../images/img-girl.png") no-repeat scroll center 0 transparent;
height: 351px;
position: absolute;
right: 50px;
top: -52px;
width: 381px;
z-index: 0;
}
#the-menu should have relative position in order for the z-index to work.
I'm having a problem displaying a small image using CSS. I'm trying to show an icon sized picture (the picture has a few pixel border so it isn't edge to edge) but the image itself isn't centered when it's displayed and part of it is being hidden by the right and bottom shadows of the surrounding box. I like the look of the shadows but I think the image is so small, the shadows of the box can't be ignored in the sizing. Here's my CSS. Any ideas?
.delete_button {
background: url('trash_can.png');
background-repeat: no-repeat;
width: 20px;
height: 24px;
display: inline;
}
Try this, adjusting the background-position values until your image is positioned correctly:
.delete_button {
background: url('trash_can.png');
background-repeat: no-repeat;
width: 20px;
height: 24px;
display: inline;
background-position : -3px -4px;
}
Expanding on this a little further, you might want to try to add all your small images into one icon image in a matrix style. Then you can select just the image you want using the width, height and background-position. This will allow all your icons to be loaded at once as a single file, reducing internet traffic. When a "new" icon is needed, it will already be cached and immediately be available.
background-image: url("icons.png");
background-position: 30px 40px; /* Use these values to select your small image contained in your large image */
background-repeat : repeat;
width : 20px; /* or however large your icon is */
height : 24px; /* or however large your icon is */
I have an issue on this page when I open it on iPad. Crimson colored top identification header goes to left and then on the right side you can see a blank space. All other major browsers including Safari shows the page as it should be except iPad. Here's the screen shot from iPad view. Any ideas whats wrong with it?
First off, it looks like you have the university logo in the upper left set as both a background image and a regular image within the <a>. Removing the regular image fixes the problem seen in both your iPad screenshot and in my desktop browser where the logo is cut off on the left and "ity" repeats in "University".
I don't have an ipad in front of me, but it's possible that might fix the problem with the right space as well. You might want to consider adding a margin-right to the form in the header so the "Go" button isn't right up against the edge of the window at 1024px resolution.
The content in your #signature div is bigger than your #signature div, so the background isn't stretching to fit the content (you can get the same reaction by shrinking the size of your window and scrolling to the left or right).
Fixes:
Remove left: -5px; from #signature a.iu
Add background: #7D110C to #signature
Change right: 0 on #signature form to right: 5px.
That should straighten things up.
EDIT
Here's what your updated styles should look like.
#identity #signature {
height: 44px;
margin: 0 auto;
position: relative;
text-align: left;
width: 990px;
background: #7D110C;
}
#identity #signature a.iu {
background: url(pw_files/img/iu_crimson.gif) no-repeat 20px 0;
display: block;
height: 44px;
position: relative;
top: 0;
width: 250px;
}
#identity form {
height: 44px;
position: absolute;
right: 5px;
top: 0;
}
I pulled these styles out of screen.css
I have simple login box, which is centered to the middle of page (vertical and horizontaly).
Here you can find DEMO for it:
http://encodable.com/uploaddemo/files/login.html
Problem is that everytime I resize browser window manually the content of div (#login-logout-box) is being resized, if someone is trying to view this login form in browser window, which height is lower then 380px, it should add scrollbars to the page. But atm instead of that box is just cutten off. Means that under low resolution this form is partically shown without ability to scroll :S (tryed several phones - Iphone and Android 2.3)
But again I don't want that div to be scrollable but whole page.
I've checked www and stackoverflow for possible answer, but nothing at all, also I'm sorry if question is unclear, I've tryed my best to describe it.
Your code should not be working in any browser at all. As per the W3C Spec, "Boxes with fixed position that are larger than the page area are clipped."
Simply change position: fixed; to position: absolute;
#login-loguout-box {
width: 380px;
height: 380px;
position: absolute;
top: 45%;
left: 50%;
margin-left: -190px;
margin-top: -190px;
margin-bottom: 20px;
border: 2px solid #cacaca;
}
Working Code
Full Screen Demo
Use the overflow setting in css, e.g.
overflow-x: auto; /* for horizontal scrolling*/
overflow-y: auto; /* for vertical scrolling */