Static Positioning in CSS

AmitDiwan
Updated on 30-Dec-2019 12:19:26

165 Views

With static positioning, the elements are not affected by the top, bottom, left, and right properties. For this, use position: static.ExampleLet us now see an example − Live Demo div.static {    position: static;    color: white;    background-color: orange;    border: 2px dashed blue; } Demo Heading This is demo text. This is demo text. position: static; This is another demo text. Output

Setting Line Height Using CSS

AmitDiwan
Updated on 30-Dec-2019 12:10:35

96 Views

To set line height, use the line-height property. Followng are the property values −line-height: normal|number|length|initial|inherit;ExampleLet us now see an example − Live Demo div {    line-height: 1.9; } Demo Heading This is demo text. This is another demo text. OutputExampleLet us now see another example − Live Demo div {    line-height: 200%; } Demo Heading This is demo text. This is another demo text. Output

Python Program to Print Diamond Shape

Pradeep Elance
Updated on 30-Dec-2019 11:53:13

449 Views

The looping features in python can be used to create many nicely formatted diagrams using various characters from the keyboard. One such shape is diamond shape which will involve multiple loops. This is because we have to print the character both vertically and horizontally. Also we have to take care of the shape gradually growing from top till middle and then gradually shrinking from middle till the bottom. For this reason, we will use two for loops each containing one more for loop inside it.Below is the code for creating the diamond shape.Exampledef Shape_of_Diamond(shape): a = 0 for m in ... Read More

Styling Lists with CSS

AmitDiwan
Updated on 30-Dec-2019 11:04:11

236 Views

Lists are ordered as well unordered. With CSS, you can set the set list item markers or an image for the markers. With that, with CSS, we can also set the position for list-item markers.Let us now see some examples −list-style-typeThe list-style-type is used to set the type of list-item marker.ExampleLet us now see an example wherein we are formatting ordered lists (ol) − Live Demo ul {    list-style-type: upper-roman; } Teams India Australia England West Indies South Africa Srilanka Outputlist-style-imageThe list-style-image property is used to set an image as the ... Read More

Text Decoration in CSS

AmitDiwan
Updated on 30-Dec-2019 10:54:26

101 Views

For text decoration in CSS, use the text-decoration property as a shorthand property for the following properties −text-decoration-line text-decoration-color text-decoration-styleExampleLet us see an example for text decoration in CSS − Live Demo .demo {    text-decoration: overline underline; } Details Examination Center near ABC College. Exam begins at 9AM. OutputExampleLet us now see another example wherein we are using separate values − Live Demo p {    writing-mode: vertical-rl;    text-decoration-line: overline;    text-decoration-color: red;    text-decoration-style: wavy; } Demo Heading This is demo text. Output

GMP OR Function in PHP

Ankith Reddy
Updated on 30-Dec-2019 10:53:17

85 Views

The gmp_or() function computes the bitwise OR of two GMP numbers.Syntaxgmp_or(n1, n2)Parametersn1: The first GMP number. It can be GMP object in PHP version 5.6 and later. Can also be numeric strings.n2: The second GMP number. It can be GMP object in PHP version 5.6 and later. Can also be numeric strings.ReturnThe gmp_or() function returns the OR of the GMP numbers. The result is also a GMP number.ExampleThe following is an example:OutputThe following is the output:7

Set Text Alignment Using CSS

AmitDiwan
Updated on 30-Dec-2019 10:50:54

2K+ Views

To set text alignment using CSS, use the text-align property. Following are the possible property values −text-align: left|right|center|justify|initial|inherit;ExampleLet us see an example to set text alignment − Live Demo .demo {    -webkit-columns: auto auto; /* Chrome, Safari, Opera */    -moz-columns: auto auto; /* Firefox */    columns: auto auto;    text-align: justify; } Machine Learning Today’s Artificial Intelligence (AI) has far surpassed the hype of blockchain and quantum computing. This is due to the fact that huge computing resources are easily available to the common man. The developers now take advantage of ... Read More

Word Spacing Using CSS

AmitDiwan
Updated on 30-Dec-2019 10:42:42

89 Views

To set spacing between words, use the word-spacing property. The property values are as follows −word-spacing: normal|length|initial|inherit;ExampleLet us now see an example − Live Demo p.demo1 {    word-spacing: normal; } p.demo2 {    word-spacing: 10px; } Demo Heading Heading2 This is demo text. Heading2 This is demo text. OutputExampleLet us now see another example − Live Demo p.demo1 {    word-spacing: 3cm; } p.demo2 {    word-spacing: 40px; } Demo Heading Heading2 This is demo text. Heading2 This is demo text. Output

Python fmod Function

Pradeep Elance
Updated on 30-Dec-2019 10:39:05

558 Views

the fmod()in python implements the math modulo operation. The remainder obtained after the division operation on two operands is known as modulo operation. It is a part of standard library under the math module. In the below examples we will see how the modulo operation gives different out puts under various scenarios.Positive numbersFor positive numbers, the result is the remainder of the operation after the first integer is divided by the second. Interesting the result always comes as a float as we can see from the type of the result.Example Live Demofrom math import fmod print(fmod(6, 7)) print(type(fmod(6, 7))) print(fmod(0, 7)) ... Read More

Find Minimum of Each Index in List of Lists in Python

Pradeep Elance
Updated on 30-Dec-2019 10:36:09

2K+ Views

In some problems we need to identify the minimum of each element in a list. But in solving the matrix operations, we need to find the minimum of each column in the matrix. That needs us to find the minimum value from list of lists. Because each column of a matrix is a list of lists.Using min() and zip()In the below example we use the min() and zip(). Here the zip() function organizes the elements at the same index from multiple lists into a single list. Then we apply the min() function to the result of zip function using a ... Read More

Advertisements