Master the Three Positioning Modes That Control Where—and How—Your Counter Lives on the Page
🎯 Overview: The Three Positioning Paradigms
CSS positioning isn’t just about where your counter appears—it fundamentally changes how it behaves. The Position setting is arguably the most architecturally significant choice in your counter’s styling, because it determines:
- 📐 Document flow behavior (does it push other content around?)
- 🧭 Positioning context (what is it positioned relative to?)
- 📜 Scroll interaction (does it move when users scroll?)
- 🎨 Theme compatibility (will it cause unexpected layout shifts?)
- 🔧 Which position controls activate (Top/Bottom/Left/Right fields)
WhoKnew Views™ offers three positioning modes: Absolute (default, recommended), Relative (document-flow-aware), and Fixed (viewport-locked). Each serves distinct use cases and behaves radically differently.
⚡ TL;DR Quick Guide: Use Absolute for 95% of cases (overlay on product image, no layout shifts). Use Fixed for sticky counters that follow scrolling. Use Relative only if your theme requires document-flow positioning (rare). When in doubt, stick with Absolute—it’s the default for good reason.
📊 The Three Modes: Side-by-Side Comparison
| Feature | Absolute | Relative | Fixed |
|---|---|---|---|
| Default Mode? | ✅ Yes (recommended) | ❌ No | ❌ No |
| Affects Document Flow? | ❌ No (removed from flow) | ✅ Yes (in normal flow) | ❌ No (removed from flow) |
| Positioned Relative To… | 📦 Product gallery container | 📄 Its natural position in HTML | 🖥️ Browser viewport/window |
| Scrolls With Page? | ✅ Yes (part of page content) | ✅ Yes (part of page content) | ❌ No (stays in same viewport position) |
| Can Cause Layout Gaps? | ❌ No | ⚠️ Yes (may add space above image) | ❌ No |
| Top/Bottom/Left/Right Work? | ✅ Yes | ❌ No (hidden/disabled) | ✅ Yes |
| Mobile Overrides Available? | ✅ Yes | ❌ No | ✅ Yes |
| Use Case | 🎯 Standard product overlays | 📋 Theme-specific flow positioning | 📌 Sticky counters (stays visible) |
| Theme Compatibility | ⭐⭐⭐⭐⭐ Excellent (works everywhere) | ⭐⭐⭐ Good (theme-dependent) | ⭐⭐⭐⭐ Good (viewport-based) |
📍 Mode 1: Absolute Positioning (The Gold Standard)
Absolute is the default positioning mode for WhoKnew Views—and for good reason. It removes the counter from the normal document flow and positions it relative to the product gallery container, giving you pixel-perfect control over placement without disrupting your theme’s layout.
🔬 How Absolute Works
When you set position: absolute, the counter:
- Leaves the document flow → Other elements render as if it doesn’t exist (no space reserved for it)
- Anchors to nearest positioned ancestor → The product gallery becomes its coordinate system
- Uses Top/Bottom/Left/Right for placement → These coordinates are relative to the gallery container edges
- Scrolls naturally with the page → Moves up/down as users scroll (it’s part of the gallery)
- Supports mobile positioning overrides → Different placement on mobile devices (covered in a dedicated article)
✅ When to Use Absolute
- 🎯 Standard product page overlays (99% of use cases)
- 📐 Avoiding theme layout conflicts (no space added above/below product image)
- 🎨 Pixel-perfect placement control (top-left corner, bottom-right, center, etc.)
- 🔧 Universal theme compatibility (works with all WooCommerce themes)
- 📱 Responsive design (enables mobile-specific positioning when needed)
🎛️ Absolute Mode Configuration
| Setting | Value | Effect |
|---|---|---|
| Position | Absolute | Activates absolute positioning |
| Top Position | 0px (default) | Distance from top edge of product gallery |
| Left Position | 0px (default) | Distance from left edge of product gallery |
| Bottom Position | auto (default) | Distance from bottom edge (if set, overrides Top) |
| Right Position | auto (default) | Distance from right edge (if set, overrides Left) |
💡 Pro Tip: Absolute positioning uses the product gallery as its coordinate system. This means top: 0px; left: 0px; places your counter at the top-left corner of the product image, not the entire page. Think of it as a coordinate grid drawn over your product photo.
📐 Visual Example: Absolute Positioning Coordinates
┌────────────────────────────────────┐
│ Product Gallery Container │
│ (0,0) ← Top-Left Origin │
│ │
│ [Counter Here] │
│ ↑ │
│ Top: 10px, Left: 10px │
│ │
│ │
│ [Counter Here] ← │
│ Bottom: 10px, │
│ Right: 10px │
└────────────────────────────────────┘🛠️ Common Absolute Positioning Recipes
Recipe 1: Top-Left Corner (Classic)
| Setting | Value |
|---|---|
| Position | Absolute |
| Top Position | 0px |
| Left Position | 0px |
| Bottom Position | auto |
| Right Position | auto |
Recipe 2: Bottom-Right Corner
| Setting | Value |
|---|---|
| Position | Absolute |
| Top Position | auto |
| Left Position | auto |
| Bottom Position | 10px |
| Right Position | 10px |
Recipe 3: Centered Top (Horizontal Center)
| Setting | Value |
|---|---|
| Position | Absolute |
| Top Position | 0px |
| Left Position | 50% |
| Bottom Position | auto |
| Right Position | auto |
Note: For perfect centering, you may need to add a negative left margin via Custom CSS equal to half the counter’s width.
Recipe 4: Inset from Edges (Professional Padding)
| Setting | Value |
|---|---|
| Position | Absolute |
| Top Position | 15px |
| Left Position | 15px |
| Bottom Position | auto |
| Right Position | auto |
📄 Mode 2: Relative Positioning (Document Flow Aware)
Relative positioning keeps the counter in the normal document flow, meaning it occupies space in the layout and affects the positioning of surrounding elements. This is rarely needed for product overlays, but some themes require it.
🔬 How Relative Works
When you set position: relative, the counter:
- Remains in the document flow → Space is reserved for it in the HTML layout
- Positioned relative to its natural position → Where it would normally appear in the HTML flow
- May cause layout gaps → The theme may render space above the product image for the counter
- Top/Bottom/Left/Right fields are disabled → You can’t manually set coordinates in Relative mode
- No mobile positioning overrides → This feature is disabled in Relative mode
⚠️ The “Gap Problem” with Relative
Relative positioning can create unexpected space above the product image in many themes. This happens because the counter is no longer an overlay—it’s part of the page’s normal content flow, so the browser reserves vertical space for it.
🚨 Warning: Relative positioning may add unwanted whitespace above your product images, especially with themes that render the counter in the HTML before the product gallery. If you see a gap appear after switching to Relative, switch back to Absolute—this is the #1 reason most users avoid Relative mode.
✅ When to Use Relative (Rare)
- 🎨 Theme explicitly requires it (some custom themes break with Absolute)
- 📋 You want the counter in the natural document flow (e.g., not overlaying the image)
- 🔧 Testing theme compatibility (debugging why Absolute isn’t working)
- 📝 Developer requested it (for custom integrations)
❌ When NOT to Use Relative (Most Cases)
- 🎯 Standard product overlays (use Absolute instead)
- 📐 Pixel-perfect placement (Relative disables coordinate controls)
- 🚫 Avoiding layout gaps (Relative causes them)
- 📱 Different mobile positioning (Relative doesn’t support mobile overrides)
🎛️ Relative Mode Configuration
| Setting | Value | Effect |
|---|---|---|
| Position | Relative | Activates relative positioning |
| Top/Bottom/Left/Right | (Disabled/Hidden) | These fields don’t appear—position is automatic |
| Mobile Overrides | (Disabled/Hidden) | Not available in Relative mode |
💡 Technical Note: In Relative mode, the plugin forces top: 0; bottom: auto; left: 0; right: auto; in the CSS to prevent offset behavior. The counter appears wherever the theme’s HTML structure places it, with no manual repositioning possible.
📊 Visual Comparison: Relative vs Absolute Layout Impact
Absolute (No Layout Impact)
Product Page Layout
┌────────────────────────────────────┐
│ [Counter overlays image] │
│ ┌──────────────────────────────┐ │
│ │ │ │ ← No extra space
│ │ Product Image │ │
│ │ │ │
│ └──────────────────────────────┘ │
│ Product Title │
│ Price: $49.99 │
└────────────────────────────────────┘Relative (Layout Impact)
Product Page Layout
┌────────────────────────────────────┐
│ [Counter here, in flow] │ ← Extra space added!
│ ┌──────────────────────────────┐ │
│ │ │ │
│ │ Product Image │ │
│ │ │ │
│ └──────────────────────────────┘ │
│ Product Title │
│ Price: $49.99 │
└────────────────────────────────────┘📌 Mode 3: Fixed Positioning (Viewport-Locked Sticky Counter)
Fixed positioning is the most unique mode—it locks the counter to a specific viewport location, meaning it stays in the same position on your screen even as users scroll. This creates a “sticky” effect where the counter follows the user down the page.
🔬 How Fixed Works
When you set position: fixed, the counter:
- Leaves the document flow → No space reserved for it (like Absolute)
- Anchors to the browser viewport → The entire visible browser window becomes its coordinate system
- Stays fixed during scrolling → Doesn’t move up/down when users scroll the page
- Uses Top/Bottom/Left/Right for viewport coordinates →
top: 0pxmeans “0px from the top of the browser window“, not the product gallery - Supports mobile positioning overrides → Especially useful for adjusting sticky placement on mobile screens
✅ When to Use Fixed
- 📌 Sticky counters that follow scrolling (always visible, even on long pages)
- 🎯 Persistent social proof (counter stays in view as users read product details)
- 🚀 High-converting products (keep urgency visible throughout the buying journey)
- 📱 Mobile scroll engagement (counter floats above content as users browse)
- 🔥 Urgency campaigns (“487 people viewed this today” stays visible)
⚠️ Fixed Mode Considerations
- Viewport coordinates are global:
top: 0px; left: 0px;places the counter at the top-left of the browser window, not the product image - Can overlap content: Since it floats above the page, ensure Z-Index is high enough to stay visible
- Mobile behavior critical: Test thoroughly on mobile—fixed elements can obstruct small screens (mobile overrides help here)
- Scrolling UX: Some users find sticky elements distracting; use judiciously
- Screen real estate: Fixed counters permanently consume viewport space
🎛️ Fixed Mode Configuration
| Setting | Value | Effect |
|---|---|---|
| Position | Fixed | Activates fixed positioning |
| Top Position | 20px (example) | Distance from top edge of viewport (browser window) |
| Left Position | 20px (example) | Distance from left edge of viewport (browser window) |
| Bottom Position | auto (default) | Distance from bottom edge of viewport (if set, overrides Top) |
| Right Position | auto (default) | Distance from right edge of viewport (if set, overrides Left) |
🎨 Creative Use Case: Set Fixed positioning with bottom: 20px; right: 20px; to create a floating “487 views in 48 hours!” badge in the bottom-right corner that stays visible as users scroll through product descriptions and reviews. Pair with Z-Index: High (1000) and Shadow Effect: Large for maximum visibility.
📐 Visual Example: Fixed vs Absolute During Scroll
Absolute Positioning (Scrolls with Page)
┌─────────────────────────┐
│ Browser Viewport │ ← User scrolls down
│ │
│ ┌──────────────────┐ │
│ │ Product Gallery │ │
│ │ [Counter] ← Moves│ │ Counter scrolls up with image
│ │ │ │
│ └──────────────────┘ │
│ │
└─────────────────────────┘Fixed Positioning (Stays in Viewport)
┌─────────────────────────┐
│ Browser Viewport │ ← User scrolls down
│ [Counter] ← Stays here! │ Counter stays in same spot
│ │
│ ┌──────────────────┐ │
│ │ Product Details │ │ Image scrolled up, counter didn't
│ │ (scrolled up) │ │
│ └──────────────────┘ │
│ │
└─────────────────────────┘🛠️ Common Fixed Positioning Recipes
Recipe 1: Top-Right Sticky Badge
| Setting | Value |
|---|---|
| Position | Fixed |
| Top Position | 20px |
| Left Position | auto |
| Bottom Position | auto |
| Right Position | 20px |
| Z-Index | High (1000) |
Recipe 2: Bottom-Left Floating Counter
| Setting | Value |
|---|---|
| Position | Fixed |
| Top Position | auto |
| Left Position | 20px |
| Bottom Position | 20px |
| Right Position | auto |
| Z-Index | High (1000) |
Recipe 3: Centered Bottom (Social Proof Bar)
| Setting | Value |
|---|---|
| Position | Fixed |
| Top Position | auto |
| Left Position | 50% |
| Bottom Position | 0px |
| Right Position | auto |
| Z-Index | High (1000) |
Note: Add Custom CSS transform: translateX(-50%); for perfect horizontal centering.
🔗 How Positioning Interacts with Other Settings
🎚️ Z-Index Layer Management
Z-Index controls the stacking order (which elements appear on top). This is especially critical for Fixed positioning, where the counter floats above page content:
| Z-Index Setting | Value | Best For |
|---|---|---|
| Low | 10 | Subtle counters that sit below most content |
| Medium | 100 | Default, works for Absolute positioning |
| High | 1000 | ⭐ Recommended for Fixed (stays above all content) |
| Custom | Any value (e.g., 9999) | Force absolute top layer, override theme elements |
💡 Pro Tip: When using Fixed positioning, always set Z-Index to High (1000) or higher. This prevents your sticky counter from being hidden behind product images, headers, sticky menus, or other theme elements as users scroll.
📐 Top/Bottom/Left/Right Controls
Position coordinate fields appear conditionally based on your Position setting:
| Position Mode | Coordinate Fields Visible? | What They Control |
|---|---|---|
| Absolute | ✅ Yes (editable) | Offset from product gallery edges |
| Relative | ❌ No (hidden) | N/A (auto-positioned by HTML flow) |
| Fixed | ✅ Yes (editable) | Offset from viewport (browser window) edges |
📱 Mobile Position Overrides
Mobile Position Override functionality is only available for Absolute and Fixed modes. This powerful feature (detailed in its own article) lets you set different Top/Bottom/Left/Right coordinates for mobile devices—perfect for adapting your counter to smaller screens.
| Position Mode | Mobile Override Available? |
|---|---|
| Absolute | ✅ Yes (see dedicated article) |
| Relative | ❌ No (option hidden) |
| Fixed | ✅ Yes (especially useful for sticky counters) |
🛠️ Troubleshooting Position-Related Issues
Issue 1: “There’s a gap above my product image”
Root Cause
You’re using Relative positioning, which reserves space in the document flow.
✅ Solution
- Change Position to Absolute
- Set Top Position to
0pxand Left Position to0px - The gap will disappear immediately—the counter now overlays the image
Issue 2: “My counter disappears when I scroll”
Root Cause
You’re using Fixed positioning with coordinates that place the counter outside the viewport after scrolling.
✅ Solution
- Check your Top/Left/Right/Bottom values—they’re relative to the viewport, not the product gallery
- If you want the counter to scroll with the page, change Position to Absolute
- If you want it to stay visible, adjust coordinates to keep it in the viewport (e.g.,
top: 20px; right: 20px;)
Issue 3: “My counter is hidden behind other content”
Root Cause
Z-Index is too low, causing the counter to render behind overlapping elements.
✅ Solution
- Increase Z-Index to High (1000) or use Custom with a value like
9999 - This is especially important for Fixed positioning, which floats above page content
- Save settings and check if the counter now appears on top
Issue 4: “Position controls (Top/Left/etc.) are grayed out/missing”
Root Cause
You’re using Relative positioning, which doesn’t support manual coordinate control.
✅ Solution
- Change Position to Absolute or Fixed to activate coordinate fields
- The Top/Bottom/Left/Right fields will appear immediately
Issue 5: “Mobile Position Override option isn’t showing”
Root Cause
Either you’re using Relative positioning (which doesn’t support overrides) or Mobile Visibility is not set to “Show on Both”.
✅ Solution
- Ensure Position is set to Absolute or Fixed
- Ensure Mobile Visibility is set to Show on Both
- The Mobile Position Override checkbox will then appear in the settings
Issue 6: “My Fixed counter blocks mobile content”
Root Cause
Fixed positioning uses the same coordinates on all screen sizes, which can obstruct small mobile viewports.
✅ Solution
- Enable Mobile Position Override (see the dedicated article for details)
- Set mobile-specific coordinates that work better on small screens
- Example: Move from
top: 20pxon desktop tobottom: 10pxon mobile
📚 Technical Deep Dive: CSS Behind the Scenes
Absolute Positioning CSS
.product-views-counter {
position: absolute;
top: 0px; /* Distance from top edge of product gallery */
left: 0px; /* Distance from left edge of product gallery */
bottom: auto; /* Not used (auto = disabled) */
right: auto; /* Not used (auto = disabled) */
z-index: 100; /* Layer order */
}Relative Positioning CSS
.product-views-counter {
position: relative;
/* Plugin forces these to prevent offset: */
top: 0;
bottom: auto;
left: 0;
right: auto;
/* Counter appears in natural HTML flow position */
}Fixed Positioning CSS
.product-views-counter {
position: fixed;
top: 20px; /* Distance from top edge of VIEWPORT */
right: 20px; /* Distance from right edge of VIEWPORT */
bottom: auto;
left: auto;
z-index: 1000; /* High value to stay above page content */
}🧭 Coordinate System Visualization
Absolute (Gallery-Relative)
Browser Window
┌─────────────────────────────────────┐
│ Header, Nav, etc. │
│ │
│ Product Gallery (Absolute Context) │
│ ┌───────────────────────────────┐ │
│ │ (0,0) ← Origin │ │
│ │ │ │
│ │ [Counter at 10px, 10px] │ │
│ │ │ │
│ └───────────────────────────────┘ │
│ │
│ Product Description, Reviews, etc. │
└─────────────────────────────────────┘Fixed (Viewport-Relative)
Browser Viewport
(0,0) ← Origin
┌─────────────────────────────────────┐
│ [Counter at 20px, 20px] ← Stays here!
│ │
│ Product Gallery (scrolls) │
│ ┌───────────────────────────────┐ │
│ │ │ │
│ │(Gallery scrolls under counter)│ │
│ │ │ │
│ └───────────────────────────────┘ │
│ │
│ Description scrolls too → │
└─────────────────────────────────────┘📱 Document Flow Behavior
In Flow (Relative)
<div class="product-page">
<!-- Counter occupies space here -->
<div class="product-views-counter">
487 views in 48 hours
</div>
<!-- Gallery pushed down by counter -->
<div class="product-gallery">
...product image...
</div>
</div>Out of Flow (Absolute/Fixed)
<div class="product-page">
<!-- Counter doesn't occupy space -->
<div class="product-views-counter">
487 views in 48 hours
</div>
<!-- Gallery starts at normal position -->
<div class="product-gallery">
...product image...
</div>
</div>🎓 Best Practices & Recommendations
✅ Do’s
- Use Absolute for 95% of cases → It’s the default for good reason (no layout conflicts, universal compatibility)
- Set Z-Index to High (1000) for Fixed mode → Ensures counter stays visible above page content
- Test scroll behavior → Preview how the counter behaves when users scroll down long product pages
- Check mobile appearance → Fixed and Absolute counters may need mobile-specific positioning
- Start with defaults → Absolute +
top: 0px; left: 0px;works universally - Use Fixed sparingly → Sticky elements can be distracting; reserve for high-priority products
- Document your positioning choice → Leave notes in Custom CSS if using unusual positioning for specific reasons
❌ Don’ts
- Don’t use Relative unless required → It causes layout gaps in most themes
- Don’t forget Z-Index for Fixed → Low Z-Index = hidden counter behind page elements
- Don’t confuse coordinate systems → Absolute = gallery-relative, Fixed = viewport-relative
- Don’t set conflicting coordinates → Using both Top + Bottom or Left + Right causes unpredictable behavior
- Don’t assume Relative is “simpler” → It’s actually more complex (theme-dependent) than Absolute
- Don’t ignore mobile testing for Fixed → Sticky counters can obstruct small screens
🎯 Golden Rule: When in doubt, use Absolute positioning with top: 0px; left: 0px; and Z-Index: Medium (100). This configuration works with 99% of themes, causes no layout issues, and can be fine-tuned later. Only switch to Fixed if you specifically want sticky behavior, or to Relative if your theme explicitly requires it.
🔗 Related Articles
- Top, Bottom, Left, Right Controls: Deep dive into coordinate values, units (px, %, em), and advanced placement techniques
- Mobile Position Overrides: Set different positions for mobile devices (separate article with full details)
- Z-Index & Layer Management: Master stacking order for overlapping elements
- Padding & Spacing: Fine-tune spacing within your positioned counter
- Opacity & Filters: Combine with Fixed for semi-transparent floating badges
- Custom CSS: Advanced positioning tricks (centering, transforms, calc() functions)
🚀 Next Steps: Now that you understand the three positioning paradigms, the next article (Top, Bottom, Left, Right Controls) will teach you where to place your counter with pixel-perfect precision. Master coordinate systems, CSS units, percentage-based positioning, and advanced techniques like mathematical centering and viewport calculations.