- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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
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.
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
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.
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; }
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
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
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
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]
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
To Continue Learning Please Login
Login with Google