Sravani S has Published 101 Answers

Set the width of the element in HTML

Sravani S

Sravani S

Updated on 24-Jun-2020 12:04:06

Use the width attribute in HTML to set the width of an element. You can use the attribute with the following elements − <canvas>, <embed>, <img>, <input>, <video>, etc.ExampleYou can try to run the following code to implement width attribute in HTML − Live Demo<!DOCTYPE HTML> <html>    <body>     ... Read More

How to indicate long quotations in an HTML document?

Sravani S

Sravani S

Updated on 24-Jun-2020 08:40:01

Use the <blockquote> tag to indicate long quotations. The HTML <blockquote> tag is used to include long quotations (i.e. quotations that span multiple lines). It should contain only block-level elements within it and not just plain text.The following is the attribute −AttributeValueDescriptioncite URLURL of the quote, if it is taken ... Read More

Create an ordered list in HTML

Sravani S

Sravani S

Updated on 24-Jun-2020 08:36:04

The HTML <ol> tag is used for creating an ordered list. You can try to run the following code to create an ordered list using the <ol> tag −The HTML <ol> tag supports the following additional attributes −AttributeValueDescriptioncompactautofocusDefines if compact rendering is required.reversed reversedSpecifies the order of the list (descending).start ... Read More

How do we display the main content in the document in HTML5?

Sravani S

Sravani S

Updated on 24-Jun-2020 08:00:11

The HTML <main> tag specifies main or important content in the document. It can be used only once per page and can't be used as a descendent of <article>, <aside>, <footer>, <header>, <nav> element.ExampleYou can try to run the following code to learn how to display the main content in ... Read More

How to create the tabbing order of an element in HTML?

Sravani S

Sravani S

Updated on 24-Jun-2020 07:37:58

Use the tabindex attribute in HTML to set the tab order of an element. It gives you the authority to change the order of your TAB usage on the keyboard.ExampleYou can try to run the following code to create tabbing order of an element in HTML −<!DOCTYPE html> <html>   ... Read More

How to display JavaScript variables in an HTML page without document.write?

Sravani S

Sravani S

Updated on 24-Jun-2020 06:42:02

Use Element.innerHTML in JavaScript to display JavaScript variables in an HTML page without document.write.You can try to work through the following code snippet −var $myName = document.querySelector('.name'); var $jsValue = document.querySelector('.jsValue'); $myName.addEventListener('input', function(event){    $jsValue.innerHTML = $myName.value; }, false);

How to detect integer overflow in C++?

Sravani S

Sravani S

Updated on 24-Jun-2020 06:01:55

The only safe way is to check for overflow before it occurs. There are some hacky ways of checking for integer overflow though. So if you're aiming for detecting overflow in unsigned int addition, you can check if the result is actually lesser than either value-added. So for example, unsigned ... Read More

How to compare float and double in C++?

Sravani S

Sravani S

Updated on 24-Jun-2020 05:41:44

Comparing floats and double variables depends on what your end goal is. If you want a runnable function without going too much in details and won't have a problem in some inaccurate calculations you can use the following function −Example#include<iostream> using namespace std; // Define the error that you ... Read More

What is the use of the '&' symbol in C++?

Sravani S

Sravani S

Updated on 23-Jun-2020 13:41:40

The & symbol is used as an operator in C++. It is used in 2 different places, one as a bitwise and operator and one as a pointer address of operator.Bitwise ANDThe bitwise AND operator (&) compares each bit of the first operand to that bit of the second operand. ... Read More

How to detect a mobile device with JavaScript?

Sravani S

Sravani S

Updated on 23-Jun-2020 12:13:01

Use the following code snippet to detect a mobile device −Examplevar device = {    Android: function() {       return navigator.userAgent.match(/Android/i);    },    iOS: function() {       return navigator.userAgent.match(/iPhone|iPad/i);    },    any: function() {       return (isMobile.Android() || isMobile.iOS());   ... Read More

1 2 3 4 5 6 7 ... 11 Next
Advertisements