I want to create text area with black borders.
TextArea dataPane = new TextArea();
dataPane.setStyle("-fx-border-color: black; -fx-border-width: 1; -fx-border-radius: 16;");
But I get this result:
Can you tell me how I can remove this blue shadow?
The blue border is not a shadow but a default focus color in caspian style of JavaFX for controls. You can see its definition in caspian.css as -fx-focus-color with default value #0093ff.
Now we can override this color palette per control. So you do
dataPane.setStyle("-fx-border-color: black; -fx-border-width: 1; "
+ "-fx-border-radius: 16; -fx-focus-color: transparent");
If you want to completely remove all the borders, shadows, highlights:
.text-area {
-fx-background-insets: 0;
-fx-background-color: transparent, white, transparent, white;
}
.text-area .content {
-fx-background-color: transparent, white, transparent, white;
}
.text-area:focused .content {
-fx-background-color: transparent, white, transparent, white;
}
.text-area:focused {
-fx-highlight-fill: #7ecfff;
}
.text-area .content {
-fx-padding: 10px;
-fx-text-fill: gray;
-fx-highlight-fill: #7ecfff;
}
Related
I am trying to to highlight a word in HTML5 using a SVG masking technique.
This is the CSS code I am using to achieve the animation on the SVG path:
#keyframes dash {
from {
stroke-dashoffset: 530;
}
to {
stroke-dashoffset: 0;
}
}
.shape path {
stroke-dasharray: 530;
stroke-dashoffset: 0;
fill: white;
opacity: 0;
}
.shape.active path {
opacity: 1;
animation: dash .5s ease-in forwards;
}
Overall, it works well. However, it shows a white fill background while the animation is played:
How can I make this transparent so it can work on any background colour?
Here is a link to the code where you can see the animation in action: https://codepen.io/willhalling/pen/QWpXpQa
EDITED: I've updated codepen link to include #enxaneta solution
I want the color of the bars in the menu icon to change on mouse hover. So far I'm only able to change the background color. Any suggestions?
Fiddle: https://jsfiddle.net/Walter69/nwczmdah/5/
.container {
display: inline-block;
cursor: pointer;
}
.container:hover {
color: #fff!important;
background: #FF0000;
}
.bar1, .bar2, .bar3 {
width: 35px;
height: 5px;
background-color: #000;
margin: 6px 0;
transition: 0.4s;
}
/* Rotate first bar */
.change .bar1 {
transform: rotate(-45deg) translate(-9px, 6px);
}
/* Fade out the second bar */
.change .bar2 {
opacity: 0;
}
/* Rotate last bar */
.change .bar3 {
transform: rotate(45deg) translate(-8px, -8px);
}
You need to add the color when hover the container:
.container:hover .bar1, .container:hover .bar2, .container:hover .bar3 {
background: #FFF;
}
https://jsfiddle.net/nwczmdah/6/
I have the following problem: when toggling custom full-screen mode from the Web application, the surrounding background is black and I want to change it (as the actual background).
Details come below.
1) Javascript code to toggle fullscreen and focus an inner element
function toggleFullScreen(elem) {
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.mozRequestFullScreen) {
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) {
elem.webkitRequestFullscreen();
}
else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
}
}
$(function () {
$("#fullscreenButton").click(function () {
var actualBody = document.getElementById("#FullScreenElementId");
if (actualBody) {
toggleFullScreen(actualBody);
}
});
$(document).on("webkitfullscreenchange mozfullscreenchange fullscreenChange MSFullscreenChange", function (/*data*/) {
var actualBodyJq = $("##FullScreenElementId");
if (actualBodyJq) {
actualBodyJq.toggleClass("fullscreen-style");
}
$("body").toggleClass("fullscreen-body-style");
});
});
2) Css styles
.fullscreen-style {
overflow-y: scroll;
background-color: rgb(255, 255, 255) !important;
}
.fullscreen-body-style {
background-color: rgb(255, 255, 255) !important;
}
Switching to full-screen mode for the div works, but applying the style for the body seems to be ignored. For the shown image, I can see this computed style for background:
Question: is it possible to control how the browser (Chrome, Internet Explorer 11+) displays the "missing area"?
I have found a way to trick the browser (Internet Explorer) not to display the black area anymore. I have changed div style to use the whole viewport with the following style:
.fullscreen-style {
overflow-y: scroll;
background-color: rgb(255, 255, 255) !important;
/* this is remove black area in IE */
position:absolute;
left:0;
top:0;
width: 100%;
height: 100%;
}
This is my current color picker:
How can I style its color preview width, border color and radius? Is it possible to get rid of "Custom color" option in the bottom and instead of default colors use my own set of colors?
I tried to use this CSS:
.color-picker {
-fx-skin: "CustomSkin";
-fx-background-color: white;
-fx-background-radius: 2;
-fx-padding: 0;
-fx-background-insets: 0, 1;
}
.color-picker .color-picker-label .text {
visibility: false;
}
.color-picker .color-picker-label{
-fx-scale-x: 1.53;
-fx-scale-y: 1.53;
-fx-spacing: 0;
-fx-padding: 3;
-fx-border-width: 0;
-fx-background-insets: 0, 1;
-fx-border-radius: 2;
}
I know this is an old question, but I stumbled upon a similar issue when trying to modify the ColorPicker preview and hopefully the below can help others trying to make similar changes
In order to target the preview with css, you need to use .picker-color as the skin contains a pane which holds the preview as a rectangle
e.g.
.picker-color {
-fx-border-color: green;
}
which targets this portion of the control, allowing you to change the width etc:
I have two probably easy CSS questions here:
http://web288.merkur.ibone.ch/klingler/
How can I get the © Klingler Fahrzeugtechnik AG 2013 in the footer vertically aligned to the bottom? I tried align-bottom and vertical align of the p tag but without luck...
The second thing is, I feal the distance between the lines of the main text is a bit narrow. I wanted to have a bigger line height. I tried changing the line-height property of the p tag to 2.5em instead of 1.5em but this did not change anything? Why is this?
p {
font-size:1em;
line-height:1.5em;
margin: 1.5em 0 0 0;
}
Do this:
footer {
position: relative;
}
.ym-g25 {
position: absolute;
bottom: 0;
}
Do this:
.ym-g25 {
width: 25%;
vertical-align: bottom;
display: table-cell;
line-height: 1;
float: none;
}