-
Hajipur, Bihar, 844101
Hajipur, Bihar, 844101
CSS Basics
CSS Styling Properties
CSS Box Model
CSS Margin
CSS Padding
CSS Borders
CSS Outline
CSS Height/Width
CSS Max-width
CSS Display
CSS Position
CSS Z-index
CSS Overflow
CSS Float
CSS Inline-block
CSS Align
CSS Box Sizing
CSS Text
CSS Fonts
CSS Icons
CSS Text Effects
CSS Web Fonts
CSS Colors
CSS Backgrounds
CSS Color Keywords
CSS Gradients
CSS Shadows
CSS Links
CSS Lists
CSS Tables
CSS Advanced Selectors & Features
CSS Combinators
CSS Pseudo-classes
CSS Pseudo-elements
CSS Attribute Selectors
CSS Specificity
CSS !important
CSS Units
CSS Variables
CSS @property
CSS Math Functions
CSS Media and Image Styling
CSS Image Styling
CSS Image Centering
CSS Image Filters
CSS Image Shapes
CSS object-fit
CSS object-position
CSS Masking
CSS Layout Techniques
CSS Website Layout
CSS Navigation Bar
CSS Dropdowns
CSS Image Gallery
CSS Counters
CSS Pagination
CSS Multiple Columns
CSS User Interface
CSS Flexbox
CSS Grid
CSS Responsive Design (RWD)
CSS Attribute Selectors allow you to select elements based on the presence or value of an attribute. They are powerful for targeting elements without needing extra classes or IDs.
input[type="text"] {
border: 2px solid green;
}
Targets all
<input>
elements withtype="text"
.
[attr]
)a[target] {
color: red;
}
Targets all anchor (
<a>
) tags that have atarget
attribute.
[attr~="value"]
)[title~="help"] {
background-color: yellow;
}
Selects elements whose
title
contains the word "help" (whole word match).
[attr^="value"]
)a[href^="https"] {
color: green;
}
Matches elements where attribute starts with "https".
[attr$="value"]
)img[src$=".png"] {
border-radius: 10px;
}
Selects all images whose
src
ends with.png
.
[attr*="value"]
)a[href*="login"] {
font-weight: bold;
}
Selects anchor tags with
"login"
anywhere in thehref
value.
[attr|="value"]
)[lang|="en"] {
font-style: italic;
}
Matches
lang="en"
orlang="en-US"
, etc.
Q1. Style all input elements of type checkbox.
Q2. Select links that open in new tab (target="_blank"
).
Q3. Change color of all elements with a data-status
attribute.
Q4. Target <img>
elements with .jpg
at the end.
Q5. Make all buttons with disabled
attribute appear faded.
Q6. Apply bold style to links that contain “signup” in their href
.
Q7. Add padding to all inputs with a placeholder
.
Q8. Set a red border for inputs with type="password"
.
Q9. Italicize all elements where lang
starts with en
.
Q10. Add underline to links that start with "mailto:".
CSS Basics
CSS Styling Properties
CSS Box Model
CSS Margin
CSS Padding
CSS Borders
CSS Outline
CSS Height/Width
CSS Max-width
CSS Display
CSS Position
CSS Z-index
CSS Overflow
CSS Float
CSS Inline-block
CSS Align
CSS Box Sizing
CSS Text
CSS Fonts
CSS Icons
CSS Text Effects
CSS Web Fonts
CSS Colors
CSS Backgrounds
CSS Color Keywords
CSS Gradients
CSS Shadows
CSS Links
CSS Lists
CSS Tables
CSS Advanced Selectors & Features
CSS Combinators
CSS Pseudo-classes
CSS Pseudo-elements
CSS Attribute Selectors
CSS Specificity
CSS !important
CSS Units
CSS Variables
CSS @property
CSS Math Functions
CSS Media and Image Styling
CSS Image Styling
CSS Image Centering
CSS Image Filters
CSS Image Shapes
CSS object-fit
CSS object-position
CSS Masking
CSS Layout Techniques
CSS Website Layout
CSS Navigation Bar
CSS Dropdowns
CSS Image Gallery
CSS Counters
CSS Pagination
CSS Multiple Columns
CSS User Interface
CSS Flexbox
CSS Grid
CSS Responsive Design (RWD)