Types of CSS: Inline, Internal, External
Types of CSS: Inline, Internal, External
33. What is the full form of css, what are the types of css
explain with example code .
CSS
Location Use Case Pros Cons
Type
Inline Inside HTML tag Quick, one- Hard to
Simple, fast
CSS (style="") element styling maintain
CSS
Location Use Case Pros Cons
Type
Internal <style> in One-page Centralized in Can’t reuse
CSS <head> websites one file across pages
External In separate .css Multi-page Clean, reusable, Needs external
CSS file websites scalable file loading
35. What are the various types of css selectors are there,
explain the utility of using each types of css selectors .
6. Descendant
div p All <p> inside <div>
Selector
p::first-letter,
12. Pseudo-element Part of an element (e.g., first letter)
p::before
36. Write the code of css image gallery .
37. Explain with example code class selector, id selector,
tag selector, sub selector, attribute selector, group selector,
global selector, universal selectors .
🎨 1. Background Properties
Property Usage Example
Sets the background background-color:
background-color
color lightblue;
Adds an image as background-image:
background-image
background url('[Link]');
background- Repeats image (or background-repeat: no-
repeat not) repeat;
background- Positions background-position:
position background image center top;
Sets background
background-size background-size: cover;
image size
background- Scroll or fix background-attachment:
attachment background fixed;
🔲 4. Border Properties
Property Usage Example
border: 1px solid
border Sets full border
black;
border-width Sets only width border-width: 2px;
Dashed, solid, dotted,
border-style border-style: dashed;
etc.
border-color Border color border-color: red;
border-
Rounds the corners border-radius: 10px;
radius
📌 5. Positioning Properties
Property Usage Example
position Specifies positioning method position: relative;
top, left, right, top: 10px; left:
Offsets from respective sides 20px;
bottom
z-index Stack order (higher = front) z-index: 10;
float Float element to left/right float: right;
clear
Prevents elements from wrapping floated clear: both;
ones
display Controls layout mode (block, inline, etc.) display: flex;
39. How css can be applied to lists, tables and explain css menu
design with example code .
40. What is the syntax of commenting in css .
💡 Rules:
Comments can span multiple lines.
CSS ignores comments—they don’t affect the layout or styling.
Used to explain code, disable parts temporarily, or add notes.