Web Development Articles - Page 139 of 918

How to apply custom color to glyphicon icon embed within a link styled with Bootstrap?

Dishebh Bhayana
Updated on 22-Feb-2023 10:53:56

559 Views

We can use glyphicons in a bootstrap project by simply giving a glyphicon-specific class to a “span” tag in HTML. Glyphicons are basically font icons that can be used anywhere in your web application, for example, in buttons, forms, inputs, texts, etc. They are provided by Bootstrap and usually consist of symbols, fonts, or graphic icons. Syntax Here, the “glyphicon” class is a Bootstrap class that allows us to use glyphicon icons in the web application, and “icon_name” refers to the particular glyphicon icon that we want to embed and use in the application. Approach 1: Using CSS ... Read More

How to apply CSS style using jQuery?

Dishebh Bhayana
Updated on 22-Feb-2023 10:51:25

7K+ Views

We can use jquery’s .css() method to apply CSS style on the given webpage. jQuery is a javascript library that helps us manipulate the DOM easily and efficiently using its various helper methods and properties. It allows us to add interactivity to the DOM as well as add and change the CSS styles of the DOM elements. Syntax $(selector).css(property, value) OR $(selector).css({ property: value, property: value, … }) JQuery css() method accepts either an argument of type object, with key as the CSS property name and value as the desired property value to be set to, or ... Read More

How to apply CSS style to the different elements having the same class name in HTML?

Dishebh Bhayana
Updated on 22-Feb-2023 10:47:42

3K+ Views

HTML classes are global attributes that are used by HTML tags to specify a list of classes that are case-sensitive in nature. These classes are then used by CSS, to apply styling to that particular tag that has the class, and by Javascript, to manipulate the HTML element’s behavior, interactivity, or styles. Approach 1; Using the dot(.) selector In this approach, we will simply use the dot (.) selector to select multiple elements having the same class names, and apply the same set of styles to them using CSS. Example In this example, we will select a “p” tag and ... Read More

How to use directives in angular 8?

Sravani Alamanda
Updated on 21-Feb-2023 18:32:00

332 Views

Directives in Angular 8, are classes that can add new behavior to the elements in the template. Directives are used to manipulate the DOM. We can change the behavior and appearance of the DOM elements using directives. Simply we can use the HTML using directives. Using directives, we can achieve reusability, readability and maintainability. Directives will give the high-level of reusability throughout the application. This will help in large application like same functionality required by many places. There are 3 types of directives − Component directives Attribute directives Structural directives We can also create custom directives based on ... Read More

Mobile

How to use an Anagular 8 Service?

Sravani Alamanda
Updated on 21-Feb-2023 18:28:01

238 Views

In Angular, services are singleton objects which normally get instantiated only once for the entire angular application. Every service contains several methods and that includes some functionality to do. It is a mechanism to share functionality or responsibility within one or more than components. We know, using angular we can create nested-based components. Once our applications are nested, we may need to use the same functionality. Instead of writing same code in multiple components. We can write one place and we can share data with different components. The best way to use service to handle this. In first versions of ... Read More

How to inject a service into the component in Angular 8?

Sravani Alamanda
Updated on 21-Feb-2023 18:18:48

5K+ Views

In Angular, services are singleton objects which normally get instantiated only once for the entire angular application. Every service contains several methods and that includes some functionality to do. It is a mechanism to share functionality or responsibility within one or more than components. We know, using Angular we can create nested-based component. Once our applications are nested, we may need to use the same functionality. Instead of writing same code in multiple components. We can write one place and we can share data with different components. The best way to use service to handle this. In first versions of ... Read More

How to add event listeners in HTML using AngularJS?

Sravani Alamanda
Updated on 21-Feb-2023 16:47:58

4K+ Views

In AngularJS, events help us to perform particular tasks, based on the action. AngularJS is rich in events and has a simple model for adding event listeners to the HTML. AngularJS supports many events related to the mouse and keyboard. All these events are applied to the HTML elements. In angularJs, we have many HTML events. Suppose we write both AngularJS and HTML events simultaneously. AngularJS event and HTML event will be executed and AngularJS event will not overwrite the HTML event. Events can be represented by using directives. Like ng-click, ng-change, ng-mousedown, ng-mouseup, ng-keydown, ng-keyup, ng-keypress, ng-mouseover, ng-paste etc. ... Read More

Difference between constructor and ngOnInit in Angular 8

Sravani Alamanda
Updated on 21-Feb-2023 17:46:31

10K+ Views

We can create robust applications using a number of life cycle functions using Angular. As it is the response of the event, the constructor and ngOnInit play important roles in developing applications. May this constructor and ngOnInit terms often confuse us. Constructor and ngOnInit will be available from the life cycle hooks of a component. This will provide extensive benefits to us in developing applications. Let’s check the differences below. Before that, let’s discuss the constructor and ngOnInit in detail. What is the Constructor in Angular 8? Constructor is a default method for a class and is called whenever we ... Read More

How to change border-color of a canvas text using Fabric.js?

Gungi Mahesh
Updated on 21-Feb-2023 15:58:10

787 Views

The fabric.Text object of Fabric.JS is used to change the corner style of a canvas-type text. Text class of Fabric.js provides the text abstraction by using the fabric.Text object, which allows us to work with text in an object-oriented way. Comparing to the canvas class the Text class provides the rich functionality. The text object contains the different properties, but to change the border color of a text canvas can be done using one of the color property i.e., borderColor. The borderColor property of a Fabric.js Text object specifies the border color of the object. Any valid CSS color value ... Read More

How to Change the Background Color of a Div on Mouse Move Over using JavaScript?

Gungi Mahesh
Updated on 21-Feb-2023 15:51:24

3K+ Views

The mouseover event is used in the JavaScript code to change the color of background to an elements of HTML. We also want to restore the color to blue after removing our mouse from the element. As a result, we have also used the mouseout event. This will happen when we remove our mouse pointer from the element. getElementById() produces an object of element which represents the element whose id attribute matches the provided string. Because element IDs must be unique if supplied, they're a convenient method to rapidly retrieve a single element. The addEventListener() function is employed to ... Read More

Advertisements