- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 10710 Articles for Web Development
19K+ Views
To affect other elements when one element is hovered, an element should be inside another element i.e. parent-child or sibling. On placing the mouse cursor on one element, the other’s property should change i.e. the hover affect is then visible. Change the color of another element when one element is hovered Example In this example, we will change the color of two boxes inside a div on mouse hover − DOCTYPE html> .parent { width: 500px; ... Read More
370 Views
The className property is used to change an element’s class. Here, we will see two examples − How to change the element’s class using className property. How to toggle between old and new classes. Change the element’s class using className property In this example, we will change the class of an element using the className property. Let’s say we have a div with class oldStyle − The div... We will set the above oldStyle class to a new class i.e. newStyle using the className property − function demoFunction() { ... Read More
374 Views
The clearfix, as the name suggests, is used to clear floats. It is generally used in float layouts. The clearfix is considered a hack to clear floats. Overflow Issue Example Let us see the problem first before moving towards the solution. We have an image here, floated to the right. It overflows outside its container since it is way taller than the element belonging to it − DOCTYPE html> div { border: 2px solid blue; ... Read More
8K+ Views
We can easily center text inside a div both horizontally and vertically. Let us see them one by one. Center Text in Div Horizontally using the text-align property To center text in div horizontally, use the text-align property. The text-align property determines the way in which line boxes are aligned within a block-level element. Here are the possible values − left − The left edge of each line box is aligned with the left edge of the block-level element's content area. right − The right edge of each line box is aligned with the right edge of the block-level ... Read More
4K+ Views
To remove extra space below the image inside div, we can use CSS. The following CSS properties can be used to get rid of the space − The vertical-align property The line-height property The display property Before moving further, let us see how the extra space below an image looks like − The image in a div can have an extra space below. It looks annoying and should be removed as shown below. We have marked the space as extra space below − Let us now see the fix − Clear the extra space below an image ... Read More
5K+ Views
We can easily vertically align elements in a div using any of the following ways − The position property The line-height property The padding property Let us see the examples one by one − Vertically align elements in a div using the position property The position property is used in positioning an element. It can be used in conjunction with the top, right, bottom and left properties to position an element where you want it. Here are the possible values of the position property − static − The element box is laid out as a part of ... Read More
831 Views
To vertically center a div element for all browsers using CSS, use the Flexbox. CSS3 provides another layout mode Flexible Box, commonly called as Flexbox. Using this mode, you can easily create layouts for complex applications and web pages. Unlike floats, Flexbox layout gives complete control over the direction, alignment, order, size of the boxes. The tag is a container for elements in HTML. We can place any type of content inside the div. The elements are first added and then CSS is used to style them. We can now only center the div vertically, but it can be ... Read More
589 Views
We can easily remove the space between inline-block elements. Before moving further, let us first create an HTML document and add inline-block elements with space −Example DOCTYPE html> Inline block elements li { display: inline-block; width: 150px; font-size: 18px; } li:nth-child(1) { ... Read More
1K+ Views
We can easily remove the space between inline-block elements. Before moving further, let us first create an HTML document and add inline-block elements with space. Inline-block elements with space We will set the style for inline block element using the display property with value inline-block − nav a { display: inline-block; background: blue; color: white; text-decoration: none; font-size: 35px; } We have set the above style for the below given element − Tutorials point ... Read More
827 Views
In this tutorial, we will learn how to avoid jQuery function conflict with any other JavaScript library. For the jQuery function, the $ symbol is simply an identifier. A $ followed by a selector indicates that it is a jQuery selector. It is given a shorter identification as $ to save time while writing longer syntax. It includes all of the functions needed by a jQuery object, such as animation(), show(), hide(), show(), CSS, and many others. Furthermore, $ is superior in terms of memory to jQuery because $ takes a byte while jQuery uses 6 bytes for the same ... Read More