mkotla

mkotla

77 Articles Published

Articles by mkotla

77 articles

Does constructor return any value in Java?

mkotla
mkotla
Updated on 23-Oct-2024 6K+ Views

No, the constructor does not return any value. While declaring a constructor you will not have anything like a return type. In general, the Constructor is implicitly called at the time of instantiation. And it is not a method, its sole purpose is to initialize the instance variables.Read more about constructors: Java Constructors Example public class Sample{ public Sample(){ System.out.println("This is a constructor"); } public static void main(String args[]){ ...

Read More

Execute a script when the element gets user input in HTML?

mkotla
mkotla
Updated on 23-Nov-2023 1K+ Views

Use the oninput event attribute to trigger when an element gets user input. You can try to run the following code to implement oninput attribute − Example           Write your name below:                            function display() {             var p = document.getElementById("myid").value;             document.getElementById("test").innerHTML = "Your answer is " + p;          }          

Read More

Convert HTML5 into standalone Android App

mkotla
mkotla
Updated on 20-Nov-2023 2K+ Views

Steps Follow the below-given steps to convert HTML5 into standalone Android App You need to first create an Android app using Eclipse. Move HTML code to /assets folder −The Assets provide a way to include arbitrary files such as text, XML, music, fonts, and video in your application. Load web view with the file − android_asset/ file  enable javascript Layout for WebView While creating a layout for WebView − WebVieww = new WebView(this); w.loadUrl("http://www.app.com/");

Read More

What is a CSS Selector?

mkotla
mkotla
Updated on 30-Jun-2020 598 Views

The selectors in CSS are patterns to select the element to style.Let us see the key selectors in CSS −SelectorDemoDescription class.demoSelects all elements with class="demo"#id#myidSelects the element with id="myid"**Used to select all the elements

Read More

CSS Text Shadow

mkotla
mkotla
Updated on 29-Jun-2020 228 Views

CSS3 added shadow effects to text, with the text-shadow property. You can try to implement the following code to add text shadow −ExampleLive Demo                    h1 {             text-shadow: 2px 2px;          }          h2 {             text-shadow: 2px 2px red;          }          h3 {             text-shadow: 2px 2px 5px red;          }          h4 {             color: white;             text-shadow: 2px 2px 4px #000000;          }          h5 {             text-shadow: 0 0 3px #FF0000;          }          h6 {             text-shadow: 0 0 3px #FF0000, 0 0 5px #0000FF;          }          p {             color: white;             text-shadow: 1px 1px 2px black, 0 0 25px blue, 0 0 5px darkblue;          }                     Welcome to my website!       Welcome to my website!       Welcome to my website!       Welcome to my website!       Welcome to my website!       Welcome to my website!       Welcome to my website!     Output

Read More

Set the border image as rounded, repeated and stretched with CSS

mkotla
mkotla
Updated on 29-Jun-2020 301 Views

The border-image-repeat property is used to set the border image as rounded, repeated and stretched with CSS.ExampleYou can try to run the following code to implement the border-image-repeat property:Live Demo                    #borderimg1 {             border: 15px solid transparent;             padding: 15px;             border-image-source: url(https://tutorialspoint.com/css/images/border.png);             border-image-repeat: round;             border-image-slice: 40;             border-image-width: 20px;          }                     This is image border example.    

Read More

Animate CSS column-rule property

mkotla
mkotla
Updated on 25-Jun-2020 271 Views

To implement animation on the column-rule property with CSS, you can try to run the following code:ExampleLive Demo                    div {             width: 600px;             height: 300px;             background: white;             border: 10px solid red;             animation: myanim 3s infinite;             bottom: 30px;             position: absolute;             column-count: 4;   ...

Read More

Apply style to the parent if it has a child with CSS and HTML

mkotla
mkotla
Updated on 25-Jun-2020 712 Views

Parent selectors are not present in CSS3. There is a proposed CSS4 selector, $, to do so, which could look like this (Selecting the li element) −ul $li ul.sub { ... }As an alternative, with jQuery, a one-liner you could make use of would be this. The: has() selector selects all elements that have one or more elements inside of them, that matches the specified selector. The tag defines a list item. The tag defines an unordered (bulleted) list.$('ul li:has(ul.sub)').addClass('has_sub');You could then style the li.has_sub in your CSS.

Read More

Style input type button with CSS

mkotla
mkotla
Updated on 24-Jun-2020 5K+ Views

The input type button can be a submit button or reset button. With CSS, we can style any button on a web page.You can try to run the following code to style input type button:ExampleLive Demo                    input[type=button] {             background-color: orange;             border: none;             text-decoration: none;             color: white;             padding: 20px 20px;             margin: 20px 20px;             cursor: pointer;          }                     Fill the below form,                Subject                    Student                              

Read More

Selects every <a> element whose href attribute value ends with ".htm" with CSS

mkotla
mkotla
Updated on 24-Jun-2020 494 Views

Use the [attribute$=”value”] selector to select elements whose attribute value ends with a specified value i.e. “.htm” here.You can try to run the following code to implement the CSS [attribute$="value"] Selector,ExampleLive Demo                    [href$ = htm] {             border: 5px solid orange;             border-radius: 5px;          }                     Java Tutorial       Java Tutorial PDF    

Read More
Showing 1–10 of 77 articles
« Prev 1 2 3 4 5 8 Next »
Advertisements