CSS Articles

Page 130 of 130

How to limit input text length using CSS3?

Vikyath Ram
Vikyath Ram
Updated on 15-Mar-2026 1K+ Views

With HTML, you can easily limit input length using the maxlength attribute. However, with CSS3, it is not possible to limit the number of input characters, since CSS deals with presentation (how your web page looks) rather than functionality or behavior. CSS cannot impose functional restrictions like character limits. The maxlength attribute is an HTML attribute that controls behavior, not presentation. Syntax /* CSS cannot limit input text length */ /* Use HTML maxlength attribute instead */ HTML Solution To limit input text length, you must use the HTML maxlength attribute − ...

Read More

How to create a modal popup using JavaScript and CSS?

Nishtha Thakur
Nishtha Thakur
Updated on 15-Mar-2026 649 Views

Creating a modal popup means adding a dialog box, which generates on click of a button and closes when the user clicks anywhere outside of the popup or on the close button. × Modal Header This is the modal content. Click outside or on × ...

Read More

How do I hide an element when printing a web page?

Alshifa Hasnain
Alshifa Hasnain
Updated on 15-Mar-2026 7K+ Views

In this article, we will learn to hide an element when printing a web page using CSS and JavaScript. When printing a web page, you can suppress elements such as navigation menus, advertisements, and interactive elements that you do not require on paper and print only the required information. Syntax @media print { selector { display: none; } } Different Approaches The following are the two different approaches to hiding an element when printing a web page − ...

Read More

How to set text alignment in HTML?

Sharon Christine
Sharon Christine
Updated on 15-Mar-2026 238K+ Views

To align text in HTML, use the style attribute to define the CSS text-align property. Just keep in mind, that the usage of style attribute overrides any style set globally. It will override any style set in the HTML tag or external style sheet. HTML style attribute specifies an inline style for an element. The attribute is used with the HTML tag, with the CSS text-align property for the center, left, and right alignment. HTML5 does not support the align attribute of the tag, so the CSS style is used to set text alignment. Syntax ...

Read More

In dynamic fashion setting a custom class to a cell in a row

Amit Sharma
Amit Sharma
Updated on 15-Mar-2026 160 Views

If you need to set CSS properties for a row, you can combine the predefined CSS class of the table along with your custom class. This allows you to apply specific styling to table cells dynamically. Syntax .table-class .custom-class { property: value; } Example: Custom Cell Styling The following example demonstrates how to apply custom styling to table cells using a combination of table class and custom class − .data-table { border-collapse: ...

Read More

Using CSS3 in SAP BSP application without using DOCTYPE tag

Amit Sharma
Amit Sharma
Updated on 15-Mar-2026 274 Views

You can use CSS3 features in SAP BSP applications even without adding a DOCTYPE tag by leveraging JavaScript libraries and polyfills that provide CSS3-like functionality. Syntax /* CSS3 features may not work without DOCTYPE */ selector { border-radius: value; box-shadow: value; transition: value; } Method 1: Using jQuery UI jQuery UI provides CSS3-like effects and styling that work across browsers without requiring DOCTYPE − .custom-button { ...

Read More

How do I center tag using CSS?

Yaswanth Varma
Yaswanth Varma
Updated on 15-Mar-2026 480 Views

Centering a in CSS is one of the most common layout tasks in web development. There are several approaches − Flexbox, Grid, and margin-based centering. Let's look at each method with examples. Syntax /* Flexbox Method */ .container { display: flex; justify-content: center; align-items: center; } /* Grid Method */ .container { display: grid; place-items: center; } /* Margin Method */ .element { margin: 0 auto; ...

Read More

Simple Contact Form using HTML CSS and PHP

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 5K+ Views

A contact form is a great way to allow users to reach out to you directly through your website. Contact forms are a crucial aspect of any website, as they allow visitors to get in touch with the website owner. A contact form on website provides an easy way for visitors to ask questions, make inquiries, or provide feedback. In this tutorial, we will be discussing how to create a simple contact form using HTML, CSS, and PHP. Step 1: Create the HTML Form The first step in creating a contact form is to create its structure ...

Read More

Difference between dot (.) and hash(# )selector in CSS

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 3K+ Views

In CSS, the dot (.) and hash (#) selectors are used to apply styles to HTML elements. The dot selector targets elements by their class attribute, while the hash selector targets a specific element by its id attribute. Dot (.) Selector − Class Selector The . (dot) selector is a class-level selector. It creates a style class that can be applied to multiple HTML elements. Any element with the matching class attribute will receive the style. .blackBorder { border: 2px solid black; } This style applies to every element that ...

Read More
Showing 1291–1299 of 1,299 articles
« Prev 1 126 127 128 129 130 Next »
Advertisements