HTML5 Password Patterns & Semantic Elements Basics for Web Development
Password Patterns 🔑
HTML mein aap pattern attribute ka use karke user input ko specific format mein restrict kar sakte hain. Isse aap ensure kar sakte hain ki jo data user enter kar raha hai, woh ek defined format ke according ho.
1. Sirf Alphabet (1 se 15 characters)
<input type="text" pattern="[A-Za-z]{1,15}" title="Sirf alphabets, maximum 15 characters">
2. Alphabets + Numbers (Koi limit nahi)
<input type="text" pattern="[A-Za-z0-9]{1,}" title="Sirf alphabets aur numbers">
3. Numbers + Decimal (Maximum 10 digits)
<input type="text" pattern="[0-9.]{,10}" title="Sirf numbers aur decimal, maximum 10 digits">
4. Sirf Letters + Numbers (Koi limit nahi)
<input type="text" pattern="[A-Za-z0-9]+" title="Sirf letters aur numbers">
5. Letters, Numbers, Underscore, @ (Koi limit nahi)
<input type="text" pattern="[A-Za-z0-9_@]+" title="Sirf letters, numbers, _ aur @">
6. Letters, Numbers, Underscore, Hyphen (1 se 25 characters, start letter se)
<input type="text" pattern="[A-Za-z][A-Za-z0-9_-]{1,25}" title="1-25 characters, start with a letter">
7. Positive/Negative Numbers (Maximum 10 digits)
<input type="text" pattern="[0-9.+-]{1,10}" title="Positive/Negative numbers, maximum 10 digits">
Semantic HTML Elements 🧩
Semantic elements woh elements hain jo apne content ka meaning clear karte hain. Yeh web page ko zyada accessible banate hain aur SEO mein madadgar hote hain.
Common Semantic Tags:
<article>...</article>
: Content like blog posts or articles.
<footer>...</footer>
: Footer content like copyright info.
<header>...</header>
: Header with navigation or site title.
<nav>...</nav>
: Navigation links for site sections.
Semantic tags help improve SEO and make content more accessible to users, especially those using assistive technologies.
HTML Entities 🔡
HTML entities special symbols ko represent karte hain jo HTML mein reserved hote hain. Aap un symbols ko apne page par show karne ke liye HTML entities ka use karte hain.
Common HTML Entities:
< < > > © ©
For example, if you want to display the <
(less than) symbol, you would write <
in your HTML code.
Happy Coding - ❤️🔥🌟💎