Create Black and White Image Using CSS

AmitDiwan
Updated on 10-Feb-2021 13:42:30

9K+ Views

By specifying grayscale value to the filter property of CSS we can create a black and white image. filter property can be used to apply special effects like blur, drop-shadow to images.SyntaxThe syntax of CSS filter property is as follows −Selector {    filter: grayscale(100%);    -webkit-filter: grayscale(100%); }ExampleThe following examples illustrate CSS filter property. Live Demo                    img {             margin: 2%;             border-radius: 25%;          }          img:nth-of-type(even) {             filter: grayscale(100%);             -webkit-filter: grayscale(100%);          }                               This gives the following outputExample Live Demo                    img {             margin: 2%;          }          img:nth-of-type(odd) {             filter: grayscale(100%);             -webkit-filter: grayscale(100%);          }                               This gives the following output

Creating a Responsive Logo with CSS min() Function

AmitDiwan
Updated on 10-Feb-2021 13:29:11

321 Views

Using the CSS min() function, we can create a responsive logo in our webpages. It allows us to specify a minimum value to a CSS attribute.SyntaxThe syntax of CSS min() property is as follows −Selector {    attribute: min(/*value*/, /*value*/); }ExampleThe following examples illustrate CSS min() property. Live Demo                    img {             float: left;             height: min(40vw, 384px);             margin: 3%;          }                 ... Read More

Create Slider Carousel with CSS Flexbox

AmitDiwan
Updated on 10-Feb-2021 13:23:13

2K+ Views

We can create an infinitely scrolling slider using CSS Flexbox with the help of JavaScript.ExampleThe following examples illustrate carousel using CSS. Live Demo                    img {             width: 100%;          }          .container {             max-width: 600px;             position: relative;             margin: 6% auto;          }          .prevbtn, .nextbtn {             position: absolute;   ... Read More

Create a Comment Box with Containing Text Using CSS

AmitDiwan
Updated on 10-Feb-2021 13:05:31

654 Views

Comment box can be created using clip-path propertySyntaxThe syntax of CSS clip-path property is as follows −Selector {    clip-path: /*value*/ }ExampleThe following examples show how we can create a comment box using CSS. Live Demo                    .cb {             position: relative;             padding: 2%;             border-radius: 8%;             width:25%;          }          .cb::after {             content: "";     ... Read More

Count Special Characters in Words Using Python Pandas

Vani Nalliappan
Updated on 10-Feb-2021 12:39:30

659 Views

Input − Assume you have a series, 0       fruits!! 1       *cakes* 2       $nuts 3       #drinks dtype: objectInput − The result for the total number of counts for more than one special character in a series is 2.Let us try to find different solutions to this question.Solution 1To solve this, we will follow the steps given below −Define a SeriesCreate special characters list of values.Set the initial value of special character and total special char count value as 0.Create a for loop and access all the values in the ... Read More

Create Combination of Multiple Vectors in R

Nizamuddin Siddiqui
Updated on 10-Feb-2021 11:21:59

3K+ Views

To create combination of multiple vectors, we can use expand.grid function. For example, if we have six vectors say x, y, z, a, b, and c then the combination of vectors can be created by using the command expand.grid(x,y,z,a,b,c).Example Live Demox1

Check If a Word Exists in an R Data Frame Column

Nizamuddin Siddiqui
Updated on 10-Feb-2021 11:14:09

845 Views

If we have a character column in an R data frame then we might want to check whether a particular value exist in the column or not. For example, if we have a gender column then we might want to check whether transgender exists in that column or not. This can be done with the help of grepl function. Check out the below examples to understand how it works.Consider the below data frame −Example Live Demox

Extract Statistical Summary from Boxplot in R

Nizamuddin Siddiqui
Updated on 10-Feb-2021 11:12:07

8K+ Views

To extract statistical summary from boxplot we can use stats function with delta operator. For example, if we have a data frame called df that contains 5 columns then the boxplot for each column can be created by using the command boxplot(df) and if we want to extract the statistical summary from this boxplot then boxplot(df)$stats can be used.Consider the below data frame −Example Live Demodf

Extract Strings Containing a Particular Substring in R Vector

Nizamuddin Siddiqui
Updated on 10-Feb-2021 11:06:39

1K+ Views

Suppose we have a vector that contains multiple string elements and we want to find out which string element has a particular substring. This can be done with the help of grep function. For example, if we have a vector called x that contains five string elements each of varying length then finding which of the elements has a substring say programming then it can be done by using the command grep("programming",x,fixed=TRUE)Example Live Demox1

Put Space Between Uppercase Words in String Vector in R

Nizamuddin Siddiqui
Updated on 10-Feb-2021 11:02:06

2K+ Views

To put space between words that start with uppercase letter in string vector in R, we can use gsub function. Since we can have uppercase letters as well as lowercase letters in the string vector hence, we need to properly specify both type of characters for creating the space between words. Check out the below examples to understand how it works.Example Live Demox1

Advertisements