Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Front End Technology Articles - Page 649 of 860
163 Views
To style every elements that is the last child of its parent, use the CSS :last-child selector. You can try to run the following code to implement the :last-child selectorExampleLive Demo p:last-child { background: orange; } This is demo text1. This is demo text2. This is demo text3. Output
306 Views
To set min-height and max-height of an element using CSS, you can try to run the following code −ExampleLive Demo div { max-height: 550px; min-height: 450px; background-color: red; } Below is a div with maximum and minimum height. Resize the web browser to see the effect. 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 demo text. This is demo text. This is demo text.
447 Views
To set the minimum and maximum width of an element, you can try to run the following codeExampleLive Demo div { max-width: 300px; min-width: 100px; background-color: red; } Below is a div with maximum and minimum width. Resize the web browser to see the effect. 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 demo text. This is demo text. This is demo text. Output
224 Views
The margin property with value auto is used to horizontally center the element within its container. You can try to run the following code to implement margin: auto;ExampleLive Demo div { width: 200px; margin: auto; border: 2px dashed blue; } This is demo text This is horizontally centered because it has margin: auto; Output
446 Views
The margin property with value inherit is used to inherit an element from the parent element. You can try to run the following code to implement margin: inherit;ExampleLive Demo div { border: 2px solid blue; margin-left: 50px; } p.ex1 { margin-left: inherit; } Inheriting left margin from the parent element This is demo text with inherited left margin. Output
82 Views
To set the color of the four borders, use the border-color property. You can try to run the following code to set border color for all the bordersExampleLive Demo p { border-style: dashed; border-color: #808000 #800000 #FF0000 #FFFF00; } This is demo text with four colored border. Output
71 Views
To set the width of the left border, use the border-left-width property in CSS. You can try to run the following code to implement the border-left-width property −ExampleLive Demo p { border-style: dashed; border-left-width: 10px; } 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 ... Read More
208 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

