Why do CSS filters not affect the background image of the html element? - css-filters

This blurs everything, except the background of <html>.
html {
background:linear-gradient(black 50%, white 50%);
filter:blur(20px);
}

Related

Grey Scroll Pane Background Image in JavaFX

I'm using JavaFX in Eclipse from JDK 1.8.0_72. I want to display an image in the background of a scroll pane. I'm using the following code to do this:
ScrollPane s2 = new ScrollPane();
s2.setContent(label);
s2.setStyle("-fx-background-image: url('DungeonRoomImage.png');");
This works just fine on other objects such as Labels and GridPanes but for some reason not on scroll panes where it's displaying a grey block in the middle covering up the image. If you look closely between the border and grey center you can see the image peeking out.
https://gyazo.com/597ce351f158c1d66c33fe301bd75feb
The same issue occurs when changing the background color of a scroll pane, but is solved by using
-fx-background:
instead of:
-fx-background-color:
I've tried using setBackground but that renders the same result
s2.setBackground(new Background(new BackgroundImage(new Image("DungeonRoomImage.png"), null, null, null, null)));
Could anyone suggest a way to get rid of the grey background or a way to work around the issue?
Here's how the background image should look
https://gyazo.com/f84873278507700aea17452321b80b20
Set the background image on the scroll pane's viewport. Using an external CSS file:
.scroll-pane .viewport {
-fx-background-image: url('DungeonRoomImage.png');
}

Get Background Color from HTML

While converting HTML to PDF, I am not getting background color applied for the text where as fore color working fine. When I debug, I found that Chunk object does not have that background color which is taken from HTML that contains background color.
Is there any way that I can find chunk background color, so that I can set it by using SetBackground method? I am using HTMLWorker.ParseToList Method and adding elements with customized formatting in pdf but want to get font background color from HTML.
sorry not possible. Even I faced this problem

How do I set a highlight colour for text in a UIWebView?

Our app uses a lot of custom UITableViewCells. Most have a few extra UILabels, and in those we can set the highlightTextColor property of the label so that when a user selects the cell, the text changes to white.
However, some of them require extra formatting, so we use UIWebViews with HTML contents; the text colour is set by the CSS embedded in the HTML. When the cell is selected, the text stays whatever colour is set in the CSS.
Is it possible to set a highlight colour for the text in the UIWebView? If so, how - is there a special CSS selector? I tried -webkit-tap-highlight-color but it had no effect.
As it appears, you can't. The -webkit-tap-highlight-color selector is used when you tap (or even tap and hold) over a link. However, the selection feature is native for iOS, and there isn't any known way to override its settings, be the highlight color or anything else.
You could try the ::selection selector, but I have had no success at all. In regular browsers it works like this:
p.normal::selection {
background:#cc0000;
color:#fff;
}
p.moz::-moz-selection {
background:#cc0000;
color:#fff;
}
p.webkit::-webkit-selection {
background:#cc0000;
color:#fff;
}
However, in mobile webkit it has no effect.

jQuery Mobile/ jqTouch Image width

I want to have a static footer image with 5 buttons for navigation in my mobile phone website. The image is here http://www.pintum.com.au/jm/footer3a.jpg. The blue icons should be the default, the yellow icon should only be visible for the hover or active state.
I want to know how can I make this image scale to the correct width on all mobile devices (landscape and portrait) and have links to other pages and make the current/active pages icon the yellow color?
What I have tried so far
I first tried to make a CSS Sprite but that go ugly (complex) quickly. Painful working with widths everywhere so the image scales correctly as I had no way of knowing the height in pixels since the width is dynamic. I could use JS to find the width and calculate height on the fly. But this sounds like overkill.
Next I tried to have a single image with a width of 100% then place div overlays on top of the image. But with this solution I could not figure out how to navigate pages using JavaScript click event, or figure out how I would be able to change the image icon on the selected page http://jsbin.com/uraya5/3/ . And detrmining the correct height for the div
Last I tried to make each button a seperate image. These seems like the easist soultion. But jQuery Mobile adds a bunch of extra styles to the button I do not know how to remove. See http://jsbin.com/uraya5/4
So whats the best/easiest way to do this?
How can I remove the style around
links?
Or can I use a single image CSS sliding door method? To reduce HTTP request.
Ok I figured it out
See soultion here http://jsbin.com/uraya5/10/
I had to:
Set width to 19% of each button for
some reason there is spacing between
each button so 20% does not work.
Set ui-bar-a background to black so
it hides the spaces between my
images
Use this JS code to navigate pages $.mobile.changePage($("#about"),
"flip", true, true);
I would still like to use a single image instead of having 5 different images to reduce http calls. So if anyone finds a eligant soultion for this please let me know.

How to change the colors of HTML form elements displayed in UIWebView?

I have an application that opens HTML pages in a UIWebView. The pages have a specific color theme, which is disrupted by form elements on the page (I have few "select" fields), which have their own color theme (white font, light gray background). CSS can't seem to force it to display in other colors.
Does anyone know how to fix that?
Thanks!
Try using -webkit-appearance: none; to disable the browser's default styling, then apply your own styles. More info and examples at 37signals.
Try using !important in your external CSS styles. It could be that the style sheets for UIWebView are inline and are overriding your external styles.
For example, select { color:#000!important; } should override any inline style text color (unless it is set to !important as well) on <select> elements.