white rectangle appearing when links pressed - css

I am making a simple menu with border-radius:5px on the background when you hover or its clicked.
I notice that for an instant when I click on it a rectangle border, a filled in white appears, which then goes round (in ff and IE11)
www.lo.ee-web.co.uk
I am making a joomla template and pulling int he bootstrap code but NOT using it (leaving it in case I put any plugins in at a later date that might want it)
I figured it might need to overwrite some bootstrap css so I tried adding styling for a:active but that doesn't seem to help. I also notice that if I press a link a second time it doesn't do it so I am guessing that's because of the cache.
Is there a way to stop this annoying box?
thanks

try to set your background-color to transparent.
In your case the css was:
You do have the template.css connected to your html though, and in there i find this:
nav ul#mainMenu li a:hover, nav ul#mainMenu li.active a {
background-color:#3d4d42;
background-color:#597060;
border-radius:5px;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#efefef), to(#cdcdcd));
background: -webkit-linear-gradient(top, #efefef, #cdcdcd);
background: -moz-linear-gradient(top, #efefef, #cdcdcd);
background: -ms-linear-gradient(top, #efefef, #cdcdcd);
background: -o-linear-gradient(top, #efefef, #cdcdcd);
color:#597060;
}
This probably causes the white background.
If you change this you might be able to fix it.
Otherwise you can also try to give your css file a new property for the background, making it transparent (or any color you want) by giving it Background-color: transparent;
If that doesn't work, maybe you should try it with !important in it.
so : Background-color: transparent !important;

Add this line in css:
a, a:active, a:focus, a:visited{outline:none;}

Related

Gradient color in other elements than text

On my homepage (https://howtogetrippedathome.com/), I want to give all the (now) red elements a gradient color.
I managed to give the menu items, the service titles and service icons gradient colors using the following CSS:
.service-icon.wow.zoomInDown {
background: linear-gradient(to bottom right, #ff2828 , #F27B26) !important;
}
.service-title {
background: -webkit-linear-gradient(bottom left, #ff2828 , #F27B26);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
However, I was not able to make the text-decoration (double underscore) of the widget titles, the read my story/see all blogs buttons and the social icons (Facebook and Instagram) this gradient. Using 'linear-gradient' after 'color:' does not work unfortunately.
Is this doable, or am I asking for something impossible? I'm curious what you guys have to say.
Best,
Maarten
The closest I got to it for the double underline was this (see https://howtogetrippedathome.com/):
.widget-title:after {
background-image: -webkit-linear-gradient(left, #ff2828 , #F27B26);;
padding: 1px;
border-bottom: 6px double #fff !important;
}
However, this has the effect that there still is a white double border visible in the about section. Setting the color of the border to transparent results in both the border and the padding having the gradient color, so they form one rectangular shape.
Another way it could be done is using:
-webkit-border-image: -webkit-gradient(...)
But I can't make it work.
Any ideas?
For gradient text you can do something like this:
background: -webkit-linear-gradient(#eee, #333);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
Source: https://css-tricks.com/snippets/css/gradient-text/
For the double underline the best option you have is to use <hr> and set a gradient background.
There is a text-decoration-color style, but it doesn't accept gradients.

Webkit scrollbar CSS, always a white box in corner

Is there any way to avoid the default white box that appears on a custom styled webkit scroll bar?
The white box only appears when overflow is going both horizontally and vertically. (Using Google Chrome)
Edit: I have tried setting body background to a different colour - still only seeing a white box.
Screenshot:
CSS:
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
border-radius: 5px;
background: rgba(0,0,0,0.35);
}
::-webkit-scrollbar-corner {
background: #0c0c0c;
}
This is a little out of date, but in chrome, you can set background colour to rgba(0,0,0,0). Anything with alpha 0 and the box won't show :)!
::-webkit-scrollbar-corner {
background: rgba(0,0,0,0);
}
As E.C.Pabon mentioned, you can use the
::-webkit-scrollbar-corner {background-color: red;}
tag, setting the background-color to transparent worked for me.
::-webkit-scrollbar-corner {background-color: transparent;}
if you only need the vertical scrollbar you can use
overflow-y: scroll;
the white is the space between the x-scrollbar and the y-scrollbar
i hope it solve your problem
No, there is no way to avoid the white box.
You can set the background-color of it (as you did making it grayish-white in:
::-webkit-scrollbar-corner {
background: #0c0c0c;
}
We deal here with pseudo elements and the color under the ::-webkit-scrollbar-corner is white. So to get the custom webkit scrollbar blend in with your lay-out, you always have to take care of the corner's color AND keep in mind that transparency is over the white color.
While the answer provided by E.C.Pabon was technically correct, the real error was Chrome 50 on x64 Linux had a bug with GTK integration. As of Chrome 51, the issue has been fixed.

Bootstrap 3 submenu parent highlight

Submenus were removed in Bootstrap 3. I added them back using this example/code:
http://bootply.com/71520
The issue is the parent menu item does not stay highlighted as we hover over the submenu. How can this be accomplished? This used to work in bootstrap 2:
http://getbootstrap.com/2.3.2/components.html#dropdowns
I tried looking all over the CSS and couldn't find this.
You need to add a new style to .dropdown-submenu:hover > a. Note, I copied the CSS from the existing styles on the a:hover.
.dropdown-submenu:hover > a {
color: #fff;
text-decoration: none;
background-color: #357ebd;
background-image: -webkit-gradient(linear,left 0,left 100%,from(#428bca),to(#357ebd));
background-image: -webkit-linear-gradient(top,#428bca,0%,#357ebd,100%);
background-image: -moz-linear-gradient(top,#428bca 0,#357ebd 100%);
background-image: linear-gradient(to bottom,#428bca 0,#357ebd 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca',endColorstr='#ff357ebd',GradientType=0);
}
http://bootply.com/96695

Where is this style coming from in CSS?

I have the following submit button in IE9:
The CSS I'm using is as follows:
.button,
input[type='button'],
input[type='submit'] {
text-decoration: none;
background: #eee;
color: #89a9d1;
padding: 4px 10px;
font-weight: bold;
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#fff', endColorstr='#eee')";
background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#eee));
background: -moz-linear-gradient(top, #fff, #eee);
}
From what I understand on this page: http://www.colorzilla.com/gradient-editor/ this should work... I can't figure out where the blue is coming from. Using the IE developer toolbar if I deselect all styles that affect this element it still shows up looking like the image I've attached.
Does anyone have any suggestions on what could be causing this?
ColorZilla does not generate gradients with three-digit hexadecimal color values as they are interpreted differently within IE's filters (in fact, I believe they're invalid color strings). This discrepancy in your code is what's causing your gradient to appear blue in IE.
You need to expand the hex colors to six digits for them to be interpreted correctly:
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#ffffff', endColorstr='#eeeeee')";

How can I get IE Filter & CSS Transparent Background to display together?

I am trying to get a transparent PNG & Gradient to display at the same in IE. Right now, the filter dominates over the background image. If I take out the filter, the PNG does display. Ideally, I would like the PNG to be on top of the gradient.
CSS:
.defaultSelection {
border: 1px solid #bbb; color: #222222; outline: 0 none;
background: url('/img/dropdown-arrow.png') right center no-repeat;
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#e9e9e9', endColorstr='#ffffff' )
}
HTML:
<li class="defaultSelection">Current Selection</li>
Good news: This is possible with IE (despite what others have said). But it does need a little hack called CSS3Pie.
CSS3Pie is a hack for IE which allows it to support a variety of CSS3 features using ordinary CSS, rather than those horrible filter styles.
See here for its supported features: http://css3pie.com/documentation/supported-css3-features/
You'll note that this includes the ability to specify a background with an image and a gradient:
As described on the page linked above, simply specify your CSS with -pie-background in addition to the normal background style, and also with the Pie behavior style to run the Pie script.
#myElement {
background: url(bg-image.png) no-repeat #CCC; /*non-CSS3 browsers will use this*/
background: url(bg-image.png) no-repeat, -moz-linear-gradient(#CCC, #EEE); /*gecko*/
background: url(bg-image.png) no-repeat, -webkit-gradient(linear, 0 0, 0 100%, from(#CCC) to(#EEE)); /*webkit*/
background: url(bg-image.png) no-repeat, linear-gradient(#CCC, #EEE); /*future CSS3 browsers*/
-pie-background: url(bg-image.png) no-repeat, linear-gradient(#CCC, #EEE); /*PIE*/
behavior: url(PIE.htc);
}
Behind the scenes, CSS3Pie creates a VML element, and layers it with the real element to achieve the desired effects (VML is a vector graphics language which is supported by IE6 and up). But you don't need to know any of this, as Pie goes to some lengths to make itself completely transparent to the developer and to the user. It does have some bugs and known issues, but overall it's a very very good tool for pulling older versions of IE up to some sort of parity with more modern browsers.
Have you tried using the gradient on the li and then applying the image on an element within the li?
<li class="defaultSelection">Current Selection<span class='bg'> </span></li>
.defaultSelection {
border: 1px solid #bbb; color: #222222; outline: 0 none;
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#e9e9e9', endColorstr='#ffffff' )
}
.defaultSelection .bg{
display:inline-block;
width: 10px;
height:10px;
background: transparent url('/img/dropdown-arrow.png') right center no-repeat;
}
This is not possible with IE as a filter gradient is essentially another background image (it takes its place.) Try reversing the order to have the filter first and the bg image last in the CSS selector, you'll most likely see the image.
Your best bet is to go with layering, or make on PNG that has both the image and transparency.

Resources