Set the style of the bottom border using CSS

George John
Updated on 21-Jun-2020 10:18:13

99 Views

To set the style of the bottom border, use the border-bottom-style property. The values for the border you can set is, dotted, double, dashed, solid, etc.ExampleYou can try to run the following code to style bottom borderLive Demo                    p.dotted {border-bottom-style: dotted;}          p.double {border-bottom-style: double;}          p.dashed {border-bottom-style: dashed;}          p.solid {border-bottom-style: solid;}          p.inset {border-bottom-style: inset;}          p.outset {border-bottom-style: outset;}                     Dotted bottom border.       Double bottom border.       Dashed bottom border.       Solid bottom border.       Inset bottom border.       Outset bottom border.     Output

Role of CSS :nth-last-of-type(n) Selector

mkotla
Updated on 21-Jun-2020 08:48:30

92 Views

Use the CSS :nth-last-of-type(n) selector to select every element that is the second element of its parent, counting from the last child.ExampleYou can try to run the following code to implement the :nth-last-of-type(n) selector:Live Demo                    p:nth-last-of-type(2) {             background: blue;             color: white;          }                     This is demo text 1.       This is demo text 2.       This is demo text 3.       This is demo text 4.       This is demo text 5.    

Style elements with a value within a specified range with CSS

Chandu yadav
Updated on 21-Jun-2020 08:40:26

67 Views

To style elements with a value within a specified range, use the CSS :in-range selector. You can try to run the following code to implement the :in-range selectorExampleLive Demo                    input:in-range {             border: 3px dashed orange;             background: yellow;          }                           The style only works for the value entered i.e. 9    

Disable text wrapping inside an element using CSS

George John
Updated on 21-Jun-2020 08:36:27

423 Views

To disable text wrapping inside an element, use the white-space property. You can try to run the following code to implement the white-space propertyExampleLive Demo                    p {             white-space: nowrap;          }                              This is demo text. This is demo text.          This is demo text. This is demo text.          This is demo text. This is demo text.          This is some text. This is demo text.          

Transform the element using x-axis with CSS3

Ankith Reddy
Updated on 21-Jun-2020 08:33:31

83 Views

Use the translateX(x) method to transform the element using x-axis.Let us see the syntaxtranslateX(x)Here,x: It is a length representing the abscissa of the translating vector.Let us see an examplediv {    width: 40px;    height: 40px;    background-color: black; } .trans {    transform: translateX(20px);    background-color: orange; }

3D transforms in CSS3

Arjun Thakur
Updated on 21-Jun-2020 08:32:01

87 Views

Using with 3d transforms, we can move element to x-axis, y-axis and z-axis.ExampleThe following an example shows the x-axis 3D transformsLive Demo                    div {             width: 200px;             height: 100px;             background-color: pink;             border: 1px solid black;          }          div#myDiv {             -webkit-transform: rotateX(150deg);             /* Safari */             transform: rotateX(150deg);             /* Standard syntax */          }                              My website                      Rotate X-axis                      My website           Output

Z-axis 3D transform with CSS3

varun
Updated on 21-Jun-2020 07:31:27

173 Views

You can try to run the following code to implement Z-axis 3D transform with CSS3:ExampleLive Demo                    div {             width: 200px;             height: 100px;             background-color: pink;             border: 1px solid black;          }          div#zDiv {             -webkit-transform: rotateZ(90deg);             /* Safari */             transform: rotateZ(90deg);             /* Standard syntax */          }                     rotate Z axis                tutorialspoint.com.           Output

Style all elements with a valid value with CSS

usharani
Updated on 21-Jun-2020 07:26:39

79 Views

Use the CSS : valid selector to style all elements with a valid value .ExampleYou can try to run the following code to implement the :valid Selector:Live Demo                    input:valid {             background: red;             color: white;          }                     Heading             The style (red color background) appears if you type a relevant/ valid email address.     Output

Regex to match lines containing multiple strings in Java

Arnab Chakraborty
Updated on 21-Jun-2020 06:33:07

535 Views

ExampleLive Demoimport java.util.ArrayList; import java.util.List; import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class SearchRegex {    private Pattern subPattern = Pattern.compile(SUBJECT_PATTERN);    private Matcher matcher;    private static final String SUBJECT_PATTERN = "(?s)Subject 1:\s(.*)Subject 2:";    public static void main(String[] args) {       String d = "Subject 1: Java" + "Subject 2: Python";       SearchRegex obj = new SearchRegex();       List list = obj.getSubject(d);       System.out.println("Address Result : " + list);    }    private List getSubject(String d){       List result = new ArrayList();       matcher = subPattern.matcher(d);       while (matcher.find()) {          result.add(matcher.group(1));       }       return result;    } }OutputAddress Result : [Java]

How to match a line not containing a word in Java Regex

Arnab Chakraborty
Updated on 21-Jun-2020 06:31:20

209 Views

ExampleLive Demoimport java.util.regex.Matcher; import java.util.regex.Pattern; public class NoRegTest {    public static void main(String[] args) {       String s="^fun";       Pattern pattern = Pattern.compile(s);       Matcher matcher = pattern.matcher("Java is fun");       if(!matcher.find()) {          System.out.println("not found");       }    } }Outputnot found

Advertisements