Skip to content

Priyeshnd555/HTML-AND-CSS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 

Repository files navigation

HTML-AND-CSS - There is Excel file in this repo download and use it ):

HTML ZERO TO HERO
Step Concept Focus Task/Exercise Modern Feature & Principle
1 Modern Semantics & A11y Root Rebuild a blog index page using only one
. Use , , , ,
, and aria-label.
Semantic Structure: Conveying meaning to search engines (SEO) and screen readers (A11y).
2 Form Validation & UX Create a registration form. Use <inputtype="email">, <inputtype="url">, and the required and pattern attributes. Do not write any JavaScript validation. Client-Side Constraint Validation: Utilizing native browser mechanisms for input checking and better mobile keyboards.
3 Interactive Content (Accordion) Build a FAQ section using the
and elements. Style the open/closed state using the [open] attribute selector in CSS.
Zero-JS Interactivity: Using native HTML for collapsible content, complete with focus management.
4 Native Modals Create a "Sign Up" button that opens a modal window using the element and its .showModal() method (minimal JS required). Top-Layer Components: The native handles focus trapping and zโˆ’index promotion automatically.
5 The Popover API (Tooltips/Menus) Implement a basic tooltip that appears on hover using the popover attribute on the tooltip element and popovertarget on the trigger element. Native UI Primitives: The modern, accessible successor for non-modal popups.
6 The Element Implement a banner image that loads a different, smaller image file on narrow viewports compared to large viewports. Performance (Responsive Images): Delivering only the necessary image size/format, reducing bandwidth.
7 Script Loading Strategy Place two external JavaScript files in the . One must use async (like analytics), and the other defer (like your UI initialization). Explain the execution difference. Render Blocking Optimization: Ensuring scripts do not halt the HTML parser, improving First Contentful Paint.
8 CSS Grid Architectural Layout Build the entire page template (Header, Sidebar, Main, Footer) using only CSS Grid with a single-line property for mobile and another for desktop using a media query. 2D Layout Mastery: Using Grid for overall page structure, not just individual components.
9 Modern Form Field Styling Style the native error states of your inputs using the CSS pseudo-classes :valid, :invalid, and :placeholder-shown. State-Based Styling: Designing for every possible input state using native hooks.
10 Meta Tags for SEO & UX Add a tag and a tag. Explain how the latter improves UX on mobile PWA installs. Critical Metadata: Controlling device display, caching, and browser appearance.
11 Custom Data & Styling Add a custom attribute, e.g., data-theme="dark", to the tag. Style specific elements based on this attribute using CSS attribute selectors, e.g., [data-theme="dark"] .card. State Management in HTML/CSS: Creating a powerful, JavaScript-readable theme system.
12 Font Performance Use a tag for a self-hosted custom font file, ensuring it loads before it's needed by the CSS. Critical Resource Loading: Manually raising the priority of essential resources (like fonts or key CSS).
13 Global Attributes & Micro-data Use the translate="no" attribute on a company name. Implement basic Schema.org Micro-data using attributes like itemscope, itemtype, and itemprop around an article. Machine Readability: Controlling machine translation and providing structured data for search result rich snippets.
14 Resource Hinting (Preconnect) Add a tag to a third-party domain (e.g., Google Fonts or an API endpoint) that your page relies on. Explain its purpose. Networking Optimization: Eliminating DNS lookup and handshake latency for external resources.
15 ITCSS/BEM Refactor (Architecture) Take the entire project and organize all HTML into semantic components and all CSS files into an ITCSS structure (Settings, Elements, Components, Trumps), enforced by BEM naming. Architectural Abstraction: Establishing a scalable system where every line of code has a defined purpose, scope, and predictable specificity.
CSS ZERO TO HERO
Step Concept Focus Task/Exercise Architectural Principle
1 ๐Ÿ“„ The Document Model Build a basic recipe page using only

,

,

, , and unordered/ordered lists.

2 ๐Ÿ“ Block vs. Inline Use a to highlight a single word red within a paragraph and
to visually separate sections.
Flow Control: Understanding how elements occupy space.
3 ๐ŸŽฏ CSS Selectors (Tiers 1 & 2) Apply a background color to the entire body, a border to a specific id element, and center all class elements. Specificity Hierarchy: ID > Class > Tag.
4 ๐Ÿ“ฆ The Box Model Create three
blocks side-by-side. Set fixed width, add padding, margin, and a border to each.
Universal Law: Everything in CSS is a box. Understanding content-box vs. border-box (future note).
5 ๐Ÿ”— Separation of Concerns Convert all styling from Steps 1-4 into a separate styles.css file using a tag. Delete all <style> tags. Maintainability: Never mix structure (HTML) and style (CSS).
6 ๐Ÿšš Flexbox Fundamentals Use display:flex on a container to center items both horizontally (justify-content) and vertically (align-items). One-Dimensional Layout: The modern standard for aligning items along a single axis.
7 ๐ŸŽจ CSS Variables Define a --primary-color and --font-size-base in :root and use them in at least three different selectors. DRY (Don't Repeat Yourself): Centralizing design tokens for consistency.
8 โœ๏ธ Form Structure Build a sign-up form using , , <textarea>, and . Use the for and id attributes correctly. Accessibility (A11y): Linking labels to inputs for screen readers.
9 ๐Ÿ“ฑ Responsive Design (Media Queries) Adjust the layout from Step 6: stack the items vertically when the screen width is less than 600px. Mobile-First Thinking: Designing for constraints before expanding.
10 ๐Ÿ–ผ๏ธ CSS Grid (Simple Layout) Use display:grid to create a 3-column layout for a picture gallery with fixed grid-template-columns. Two-Dimensional Layout: The best tool for overall page structure.
11 ๐Ÿ–ฑ๏ธ Pseudo-Classes Add hover effects to your buttons and style all :nth-child(even) list items with a light gray background. State Management: Styling elements based on user interaction or position.
12 ๐Ÿ”ก External Fonts/Icons Integrate a custom Google Font and use a simple icon library (like Font Awesome) in your layout. Asset Management: Understanding how to pull in external resources cleanly.
13 ๐Ÿ“› BEM Naming Convention Refactor your entire CSS from Step 10 to use BEM (Block-Element-Modifier) naming, e.g., button__primary. Scalability & Predictability: Creating unambiguous, component-specific styles.
14 ๐Ÿ•ต๏ธ Advanced Selectors Use the attribute selector, e.g., [type="submit"], and the direct child selector, e.g., div>p, to style elements. Precision Targeting: Writing CSS that is less coupled to the exact HTML structure.
15 ๐Ÿงฉ Component Thinking (Review) Separate your recipe page (Step 1) into three distinct HTML partials (Header, Main, Footer) and use BEM/Flexbox to build each as a reusable "component." Architectural Abstraction: Preparing for real-world frameworks (React, Vue, etc.).
Step Concept Focus Task/Exercise Architectural Principle
1 ๐ŸŽญ Advanced Specificity & Inheritance Create a structure where a style defined on a parent
is accidentally overridden by a deep descendant selector. Fix it using low specificity and classes.
Maintainability: Aim for the lowest necessary specificity to win, avoiding the !important hack.
2 ๐Ÿ”„ box-sizing: border-box Standard Implement the CSS reset that applies box-sizing: border-box globally (*, *::before, *::after). Explain why this prevents layout shift. Predictable Layout: Establishing a consistent model for calculating dimensions.
3 ๐Ÿงฎ CSS Functions (calc() and clamp()) Use calc() to set a column width to 50%โˆ’20px. Then use clamp() to set a headline font size that scales between 1.5rem and 3rem based on viewport width. Fluidity: Creating styles that dynamically respond to the environment without media query breakpoints.
4 ๐Ÿ“ position: sticky and Scroll Effects Build a simple navigation bar that scrolls normally for 200px and then becomes sticky at the top of the viewport. Enhancing UX: Managing element positioning relative to the viewport scroll offset.
5 ๐Ÿ› ๏ธ BEM Implementation (The Modifier) Refine a component (.card) to introduce modifiers for different states (.card--disabled, .card--error) and sizes (.card--large). Scalable State Management: Decoupling style variations from the base component.
6 โœจ CSS Transitions Add smooth, hardware-accelerated transitions to a button's background-color and transform: scale(1.05) on hover. Explain why you transition transform instead of width/height. Performance: Prioritizing properties that the browser can animate on the GPU (compositor layer).
7 ๐ŸŒ€ CSS Animation (@keyframes) Create a simple loading spinner animation using @keyframes to rotate an element continuously. Liveliness: Defining complex, multi-step visual sequences.
8 โš–๏ธ Advanced Flexbox (flex-grow, flex-shrink) Create a layout with a primary content area and a sidebar. The sidebar has a fixed width, and the main content must take up all remaining space. Space Distribution: Controlling how elements share and consume available space proportionally.
9 ๐ŸŒŠ Advanced Grid (auto-fit, minmax()) Implement a truly responsive image gallery using grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)). No media queries allowed. Intrinsic Web Design: Letting the browser intelligently manage the number of columns based on content constraints.
10 ๐Ÿ“‚ Cascade Layers (@layer) Introduce @layer into your CSS to explicitly define the order in which your reset, components, and utilities apply their styles. Predictable Cascade: Gaining control over specificity conflicts by overriding the source order mechanism.
11 โšก Performance: will-change Use the will-change property judiciously on an element that is about to be heavily animated (e.g., when a menu opens). Discuss the risks of overuse. Rendering Optimization: Hinting to the browser which elements need special preparation for faster updates.
12 ๐Ÿ“ Custom Media Queries Define a custom property for a breakpoint (--tablet: 768px) and use it within an @media rule in a preprocessor-like syntax (or simulate the concept). Design Token Management: Centralizing layout breakpoints for consistency across the project.
13 โ™ฟ Accessibility (Focus Styles) Ensure all interactive elements have highly visible and well-designed focus states (:focus-visible) that don't rely on the browser default blue outline. Inclusive Design: Guiding keyboard users by making the currently active element clear.
14 ๐Ÿ—๏ธ Architectural Refactoring (ITCSS) Organize your entire styles directory into files representing ITCSS (Inverted Triangle CSS) layers: Settings, Tools, Generic, Elements, Objects, Components, Trumps. System Thinking: Structuring a massive codebase from low-specificity (foundation) to high-specificity (overrides).
15 ๐ŸŒŽ Logical Properties Refactor padding/margin from padding-left to padding-inline-start, etc. Explain why this is a must-use practice for a globalized application. Internationalization (i18n): Supporting languages that read right-to-left (RTL) without duplicating CSS code.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors