Position Text to Top Right on an Image with CSS

Nancy Den
Updated on 24-Jun-2020 07:33:29

1K+ Views

To position text to top right, use the right and top property. You can try to run the following code to implement it:ExampleLive Demo                    .box {             position: relative;          }          img {             width: 100%;             height: auto;             opacity: 0.6;          }          .direction {             position: absolute;             top: 10px;             right: 19px;             font-size: 13px;          }                     Heading One       Below image has text in the top right:                          Top Right Corner          

C++ Program to Find GCD

Samual Sam
Updated on 24-Jun-2020 07:31:44

14K+ Views

The Greatest Common Divisor (GCD) of two numbers is the largest number that divides both of them.For example: Let’s say we have two numbers are 45 and 27.45 = 5 * 3 * 3 27 = 3 * 3 * 3So, the GCD of 45 and 27 is 9.A program to find the GCD of two numbers is given as follows.Example Live Demo#include using namespace std; int gcd(int a, int b) {    if (b == 0)    return a;    return gcd(b, a % b); } int main() {    int a = 105, b = 30;    cout

Test Java String for Case-Insensitive Regex Pattern

Arnab Chakraborty
Updated on 24-Jun-2020 07:29:15

397 Views

the syntax? i:x makes the string search case-insensitive. for egpublic class RegCaseSense {    public static void main(String[] args) {       String stringSearch = "HI we are at java class.";       // this won't work because the pattern is in upper-case       System.out.println("Try this 1: " + stringSearch.matches(".*CLASS.*"));         // the magic (?i:X) syntax makes this search case-insensitive, so it returns true       System.out.println("Try this 2: " + stringSearch.matches("(?i:.*CLASS.*)"));    } }

C++ Program to Swap Two Numbers

Samual Sam
Updated on 24-Jun-2020 07:26:57

2K+ Views

There are two ways to create a program to swap two numbers. One involves using a temp variable and the second way does not use a third variable. These are explained in detail as follows −Program to Swap Two Numbers using temp VariableThe program to swap two numbers using a temp variable is as follows.Example Live Demo#include using namespace std; int main() {    int a = 10, b = 5, temp;    temp = a;    a = b;    b = temp;    cout

Fix Python Program Issues

Arnab Chakraborty
Updated on 24-Jun-2020 07:26:01

124 Views

The first problem u are getting in the bold portion is due to non-indent block, put one indentation there.second problem is name variable is not definedfollowing is the corrected one -print ("Come-on in. Need help with any bags?") bag=input ('(1) Yes please  (2) Nah, thanks   (3) Ill get em later  TYPE THE NUMBER ONLY') if bag == ('1'): print ("Ok, ill be right there!") if bag == ('2'): print ("Okee, see ya inside. Heh, how rude of me? I'm Daniel by the way, ya?") name="Daniel" print (name + ": Um, Names " + name) print ("Dan: K, nice too ... Read More

Center an Image with CSS

Arjun Thakur
Updated on 24-Jun-2020 07:24:59

185 Views

To center an image, use the margin-left, margin-right and block CSS properties. You can try to run the following code to center an imageExampleLive Demo                    img {             border: 2px solid orange;             border-radius: 3px;             padding: 7px;          }          img {             display: block;             margin-left: auto;             margin-right: auto;             width: 50%;          }                        

Check Whether a Number is Even or Odd in C++

Samual Sam
Updated on 24-Jun-2020 07:24:38

13K+ Views

A number is even if it is divisible by two and odd if it is not divisible by two.Some of the even numbers are −2, 4, 6, 8, 10, 12, 14, 16Some of the odd numbers are −1, 3, 5, 7, 9, 11, 13, 15, 17Check Whether Number is Even or Odd using ModulusA program to check whether number is even or odd using modulus is as follows.Example Live Demo#include using namespace std; int main() {    int num = 25;    if(num % 2 == 0)    cout

Scale Down an Image with CSS to Make it Responsive

Nishtha Thakur
Updated on 24-Jun-2020 07:22:53

437 Views

To make an image responsive, you can try to run the following code:ExampleLive Demo                    img {             max-width: 100%;             height: auto;          }                        

C++ Program to Find Largest Number Among Three Numbers

Samual Sam
Updated on 24-Jun-2020 07:22:40

5K+ Views

The largest number among three numbers can be found using if statement multiple times. This is given in a program as follows −Example Live Demo#include using namespace std; int main() {    int a = 5 ,b = 1 ,c = 9;    if(a>b) {       if(a>c)       cout

Add Background Music in HTML

Vrundesha Joshi
Updated on 24-Jun-2020 07:22:33

11K+ Views

The HTML tag is used to play music in the background. This tag is for Internet Explorer only.ExampleYou can try to run the following code to add background music in HTML −           HTML bgsound Tag                     Plays sound file in the background.     The HTML tag also supports the following attributes −AttributeValueDescriptionloopnumberLets you replay a background soundtrack a certain number of times.srcURLSpecifies the path of the sound file.

Advertisements