October 22 2015

CSS set opacity background color only not text and image

Tagged Under :

css3
To set the opacity level for a <div> element as the below example:
div {
    opacity: 0.5;
}
But the following example will let the content inside the <div> become transparent as well.

Instead of using “opacity” to set transparent background-color. You can try using “rgba” function as below.
background-color: rgba(255, 0, 0, 0.5);
Now, only the background is transparent.

October 17 2015

CSS removing dotted outline when click link

Tagged Under :

css3
A links <a> by default have a dotted outline around them when user click it, and it will be a gray color around on it.This is default styling for the purpose of accessibility. For folks without the ability to use a mouse, they still need some visual indicator that they currently have a link active.
css3
To remove the dotted outline, just include this as a part of your CSS
a:link, a:hover, a:active, a:focus {
  outline: 0;
}