CSS select with rounded corner and overlapping background color - background-color

I am applying a border radius on a select element that has a background color.
Instead of following the curvers of the border, the background color overlaps the curves and appears in a square box.
I can't figure out what css property I must use to solve this issue.
background-color: #FF0;
border-radius: 24px;
border: 4px solid #F09;
Here is the jsfiddle: http://jsfiddle.net/JsgnR/
thanks for your help

My feeling about this is, to get this to work in every common browser, you will have to rebuild the select with JS ... unfortuneatly styling selects with css like a divbox still not is possible as you would expect. In latest Firefox your code looks nice in browser, because firefox decided to let the border overlap the select, in latest opera the border will be underneath the select, because they decided to.
you see that on the options , try to style them via css, you are not able and they look ugly

You can wrap <select> element in <span></span> and add the required properties to css for
This solution: http://jsfiddle.net/JsgnR/5/

Related

Material design input text field label is in incorrect place after focus

I have code like this:
<v-text-field label="Outlined" outlined />
After I focus this input text is going top left corner of input as expected but it's actually hovering the line:
What might be the reason?
I was trying to debug it and I find this very weird to me. Basically the label element has binded style left: 0 and position absolute ofcourse, then the outer dic which is .v-text-field-slot has position relative but the label is not actually starting at 0px from the left
It doesn't have any padding or something either:
So basically I have no clue why it doesn't stick to left side of the outer relative positioned div.
Actually thanks to Firefox I found out where the issue lays:
Because of the transform scale to 0.75 it's not at the very left of outer div. I'm now trying to find out the fix and I'm wondering why Vuetify didn't handle that.
I acutally found solution by modifing .v-label--active class:
.v-label--active {
transform: translateY(-28px) scale(1) !important;
font-size: 12px !important;
padding-right: 8px;
background-color: white;
}
but it's more like hack than real solution. Also if I will have this on some other background then white, it will look bad. So basically I'm still looking for solution but for now I'll move on with above css.
Edit: The real solution was that I was missing <v-app></v-app> wraping my entire app.

Browsers and font smoothing

I have a problem rendering the "font-smoothing" CSS property with html2canvas on all browsers I have (FF/Chrome/Safari/0pera)
But trying desperately to solve that, I eventually wondered why I had to smooth the text in the first place and i noticed that only the fonts displayed on a dark background were causing problems.
So, I made a JSFiddle to make some tests (see the link below)
If you are on Mac (I don't know about PC's browsers), you can see with jsFiddle that:
the black font on a white background is totally ok.
the white version of the same font on a black background is now bolder and messier for whatever reason.
And this would be resolved only if I apply a css "font-smoothing" property to it.
Nothing changed in the css and the font is absolutely standard.
All that changed is the constrast: dark background with a bright font or the contrary.
So, clearly, it's not a problem related to the font or to a technically blocking issue. It just depends on the background and the font color.
I originally thought it was because of my fancy font but even the standard webfonts will generate the problem.
So, at the end of the day, it only seems to be a matter of contrast.
Black on white is ok while white on black is not.
Is there any (css) workaround to get the same results, whatever the background luminosity/contrast or font color, whitout using "font-smoothing" as a non standardized fix then?
The contrast thing is probably a known issue and I can't believe it has no standard fix or, at least, a workaround that would work without browser-specific css properties.
Applying a css property according to the background color seems very awkward.
Here is the html:
<div class="white_no_smoothing">Test of text 0123</div>
<div class="black_no_smoothing">Test of text 0123</div>
<div class="black_smoothing" >Test of text 0123</div>
Here is the CSS:
.white_no_smoothing{
background:#fff;
color:#000;
width:250px;
height:50px;
display:block;
font-size:36px;
}
.black_no_smoothing{
background:#000;
color:#fff;
width:250px;
height:50px;
display:block;
font-size:36px;
}
.black_smoothing{
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
background:#000;
color:#fff;
width:250px;
height:50px;
display:block;
font-size:36px;
}
JSFiddle:
https://jsfiddle.net/Lzy4s4tw/3/
Thanks.

D3: Set background colour for a chart

I'm working on a visualisation involving stacked histogram with really thin bars.
The problem is that white background introduces unpleasant visual vibration and make bars somewhat hard to interpret:
http://i.stack.imgur.com/GN0XD.png
What I'm looking for is a way to set a specific colour for chart background. I've tried to set it for SVG element like so:
svg {
background-color: #ccc;
}
But (obviously) it doesn't work properly:
http://i.stack.imgur.com/ctbYo.png
How do I set a background colour so that it'll be exactly the same shape as a chart?
I managed to come to this quick-and-dirty solution. Just adding a one pixel pseudo-shadow to the right of each bar:
rect {
-webkit-svg-shadow: 1px 0px #ccc;
}
Produces this:
http://i.stack.imgur.com/xSVOD.png
How is the chart being instantiated? by using svg { background-color: #ccc;} you are setting the background color of all svg elements to #ccc (except where over-ridden), so if your chart is a child of another svg element with some margins it would explain why the alignment is no good.
One strategy to go about fixing may be to use your browser's debugging abilities (ctrl+shift+i to bring up 'developer tools' in chrome) to take a look at the DOM elements and try to narrow down which ones cover which areas of the graph vs the areas of the graph plus the margins on the bottom/left. not sure about other browsers but chrome is useful in that if you hover over an element in the html document it will 'highlight' that element in the browser. This might help you narrow down which objects specifically need to be stylized.

Border colours in IE10 incorrect - all other browsers OK

I have noticed that all my table borders when viewed in IE10 are showing up as dark grey / black, no matter what colour I set them within the HTML code.
How do I overcome this? Why is it doing it? The borders are appearing the correct colour in all other browsers.
Here is an example - http://www.xplore.net.au/programs.htm
Note the ugly black border which is actually set at:
<table width="950" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#dcdcdc">
IE10 no longer supports the bordercolor HTML attribute. Using presentational attributes on markup, such as tables, is deprecated, and sees less use these days. To guarantee things work in the future, you should consider switching to styling with CSS.
In this case, to get it working you could remove the border and bordercolor attributes, and add the styling via CSS instead.
See this example showing bordercolor no longer working in IE10, and the equivalent in CSS:
http://jsfiddle.net/kfxdh/
#css {
border: 3px solid green;
}
Note that unlike the border and bordercolor properties, this does not put borders around the individual cells. if you wish to emulate that, you could do the same by adding a border to the tds:
#css td {
border: 1px solid green;
}
See http://jsfiddle.net/kfxdh/1/
In IE10, child elements like tables inherit the color from parent tags like body tag. I also had the same issue in which my table borders are coming as RED, but when I removed the color attribute from BODY tab it worked for me.
Please try.

1px gap when positioning absolute inside a display table element in chrome

This is my first question here.
I was trying to get an element vertically aligned inside a parent with fixed width and height. Inside the parent box there is also a header, that needs to be absolutely positioned in the bottom.
When working on it, checking cross browser issues I saw a difference on chrome. In FF, IE 8 & 9 it works as it should, if you open the sample in Chrome (19 right now) it gives a 1px gap to the parent as you may see.
Interactive example of the problem - CSSDeck
How I see it - 1px gap
I have tried removing white space, and quite a few things but I couldn't get to remove that gap...
Is this a bug? If you could help me remove the gap, or achieve the same result in a clean way that works cross browser (ie8+) it would be great.
See my example fiddle: http://jsfiddle.net/tnRem/
Basically I removed display: table from #outer and set height: 250px and box-sizing: border-box; (only for IE8+) to #inner.
I tried it with Chrome 19.0.1084.46, Fx12 and IE8

Resources