Front End Technology Articles

Page 566 of 652

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 673 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 168 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 289 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 492 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

How to display logged-in user information in PHP?

Dishebh Bhayana
Dishebh Bhayana
Updated on 15-Mar-2026 3K+ Views

In this article, we will learn how to display logged-in user information using PHP sessions. When building web applications with authentication, displaying user information on various pages provides a personalized experience for users. We can implement user authentication and display logged-in user information using PHP sessions along with HTML forms. Let's explore this with practical examples. Basic User Authentication System This example demonstrates a complete login system with user authentication and information display − Filename: login.php Login Page Login ...

Read More

How to Test a URL for 404 error in PHP?

Pradeep Kumar
Pradeep Kumar
Updated on 15-Mar-2026 3K+ Views

In PHP, testing a URL for 404 errors is essential for validating links and ensuring proper user experience. PHP offers several methods to check URL status codes, each with different levels of efficiency and control. Using file_get_contents() The simplest approach uses file_get_contents() with a custom stream context to handle errors gracefully ? This method creates a stream context with ignore_errors set to true, preventing PHP from throwing warnings on HTTP errors. The $http_response_header variable is automatically populated with headers from the last HTTP request. Using get_headers() A more efficient approach using ...

Read More

How to prevent XSS with HTML/PHP?

Mohit Panchasara
Mohit Panchasara
Updated on 15-Mar-2026 853 Views

Cross-Site Scripting (XSS) is a major threat to web application security because it allows attackers to inject malicious scripts into reputable websites. This attack depends on innocent consumers, exposing important information or potentially gaining control of their accounts. Understanding and combating XSS threats is critical for maintaining a strong security posture as web applications become more complex and dynamic. What are XSS Attacks? Cross-Site Scripting (XSS) attacks are a common security risk in web applications. Attackers take advantage of vulnerabilities in web pages to inject and execute malicious scripts on the browsers of unaware users. The Different ...

Read More
Showing 5651–5660 of 6,519 articles
« Prev 1 564 565 566 567 568 652 Next »
Advertisements