WhoKnew Views™ | Top, Bottom, Left, Right Controls

Skip to main content
Table of Contents
Print

Master Pixel-Perfect Positioning with Four Coordinate Axes and Dual-Unit Control

The Top, Bottom, Left, Right controls are your precision instruments for placing view counters exactly where you want them. Think of them as GPS coordinates for your counter—four numeric values that define distance from the edges of either the product gallery (Absolute mode) or the browser viewport (Fixed mode).

These aren’t just simple number fields—they’re dual-mode inputs that support both pixels (px) and percentages (%), giving you the flexibility to create fixed-position designs or fluid, responsive layouts that adapt to any screen size.

⚡ Quick Win: Start with top: 0px; left: 0px; for a top-left corner placement, then adjust in 5px or 10px increments while watching the live preview. Use percentage values (like 50%) for automatic centering. Master these four fields, and you can place your counter anywhere with surgical precision.


📐 The Four Axes: A Complete Reference

Your counter’s position is defined by four independent coordinate values, each controlling distance from a specific edge. Understanding how these interact is crucial for mastery.

📊 Coordinate Overview

ControlMeasures FromDirectionDefault ValueCommon Use
Top PositionTop edge ↓Downward0 (pixels)Push counter down from top
Bottom PositionBottom edge ↑Upwardauto (disabled)Anchor to bottom, push up
Left PositionLeft edge →Rightward0 (pixels)Push counter right from left
Right PositionRight edge ←Leftwardauto (disabled)Anchor to right, push left

🔑 Key Concepts

1️⃣ auto = Disabled

When a coordinate is set to auto (the default for Bottom and Right), that axis is inactive. The counter uses the opposite axis instead. For example:

  • Top: 10px, Bottom: auto → Counter positioned 10px from top (Bottom is ignored)
  • Left: 0px, Right: auto → Counter positioned at left edge (Right is ignored)
2️⃣ Opposing Axes Override

If you set both opposing coordinates (e.g., Top and Bottom, or Left and Right), the Bottom/Right values override. This is standard CSS behavior:

  • Top: 0px, Bottom: 10px → Counter anchors to bottom (Top ignored)
  • Left: 0px, Right: 20px → Counter anchors to right (Left ignored)

⚠️ Common Mistake: Don’t set conflicting values like top: 0px and bottom: 0px at the same time—the counter will stretch to fill the space vertically, which is almost never what you want. Use auto on the axis you’re not using.

3️⃣ Units Matter: px vs %

Every coordinate accepts two units via a dual-mode input (number field + dropdown):

UnitBehaviorBest ForExample
px (Pixels)Fixed, absolute distancePrecise, consistent placement across all screens15px = always 15 pixels from edge
% (Percentage)Relative to container sizeResponsive, fluid layouts; centering50% = halfway across container

🖥️ Coordinate Systems: Where Are You Measuring From?

The meaning of your coordinate values changes dramatically based on your Position mode. This is the most critical concept to understand.

📦 Absolute Positioning: Gallery-Relative Coordinates

When Position = Absolute, all coordinates measure from the product gallery container edges. The gallery becomes your coordinate grid.

Visual Example
┌─────────────────────────────────────┐
│  Product Gallery Container          │ ← This is your origin
│  (0,0) Top-Left                     │
│                                     │
│  top: 20px →  [Counter Here]        │
│  left: 20px →   ↑                   │
│                                     │
│                                     │
│                   [Counter Here] ←  │ 
│                   ↑                 │
│  bottom: 20px, right: 20px          │
└─────────────────────────────────────┘
📍 Absolute Coordinate Examples
SettingVisual ResultUse Case
top: 0px; left: 0px;Flush with top-left corner of imageClassic overlay position
top: 15px; left: 15px;15px inset from top-left cornerProfessional padding from edges
bottom: 10px; right: 10px;10px inset from bottom-right cornerSubtle, unobtrusive placement
top: 50%; left: 50%;Centered horizontally & vertically*Centered badge (requires CSS transform)

*Percentage centering automatically applies transform: translateX(-50%) translateY(-50%) for perfect alignment.

🖥️ Fixed Positioning: Viewport-Relative Coordinates

When Position = Fixed, all coordinates measure from the browser viewport (the visible window) edges. The counter stays in this position even when users scroll.

Visual Example
Browser Viewport (Visible Area)
┌─────────────────────────────────────┐
│ (0,0) Top-Left of SCREEN            │
│                                     │
│ top: 20px →  [Counter Stays Here]   │ ← Sticky position
│ right: 20px ←   During Scrolling    │
│                                     │
│  ┌─────────────────────────────┐    │
│  │ Product Image (scrolls)     │    │ ← Page content
│  │                             │    │   moves under
│  └─────────────────────────────┘    │   the counter
│                                     │
└─────────────────────────────────────┘
📍 Fixed Coordinate Examples
SettingVisual ResultUse Case
top: 20px; right: 20px;Top-right corner of screen (sticky)Persistent social proof badge
bottom: 20px; left: 20px;Bottom-left corner of screen (sticky)Floating urgency indicator
bottom: 0px; left: 50%;Centered at bottom of screenSocial proof bar (footer-style)
top: 100px; right: 0px;Right edge, 100px below headerSidebar-style sticky counter

💡 Pro Tip: Fixed positioning is viewport-global—your coordinates apply to the entire browser window, not just the product image. This is why Fixed counters stay visible during scrolling—they’re anchored to your screen, not the page content.

📄 Relative Positioning: No Manual Coordinates

When Position = Relative, the Top/Bottom/Left/Right fields are hidden and disabled. The counter appears wherever the theme’s HTML places it—you can’t manually position it.


🔢 Units Deep Dive: Pixels vs Percentages

Each coordinate field has a number input and a unit dropdown (px or %). Choosing the right unit is critical for your design goals.

📏 Pixel Units (px): Fixed Precision

✅ When to Use Pixels
  • Consistent placement across all devices: top: 20px always means 20 pixels, regardless of screen size
  • Precise insets from edges: “I want 15px of padding” = top: 15px; left: 15px;
  • Small adjustments: Fine-tuning position by 5px or 10px increments
  • Fixed positioning: Sticky counters benefit from pixel-perfect viewport placement
📐 Pixel Value Guidelines
Pixel RangeVisual EffectRecommended Use
0pxFlush with edge (no gap)Edge-to-edge placement
5-10pxMinimal breathing roomSubtle padding, compact layouts
15-20px ⭐Professional spacingMost common choice, balanced aesthetics
30-50pxGenerous insetProminent placement, avoiding busy edges
100px+Far from edgeFixed positioning (below headers, avoiding nav)
Negative valuesPull counter outside containerAdvanced: overflow effects (use carefully!)

💡 Design Standard:15px insets (top: 15px; left: 15px;) are the sweet spot for professional-looking product overlays. They provide enough padding to avoid edge-bleeding while keeping the counter visually connected to the product image.

📊 Percentage Units (%): Fluid Responsiveness

✅ When to Use Percentages
  • Centering: left: 50% places the counter at the horizontal midpoint
  • Responsive layouts: Counter position adapts to different product image sizes
  • Proportional placement: “I want the counter 25% from the left” remains constant as container size changes
  • Fluid designs: E-commerce sites with variable product image dimensions
📐 Percentage Value Guide
Percentage ValueVisual EffectTypical Use
0%Left/Top edge (same as 0px)Edge alignment
25%1/4 across containerOff-center left alignment
50% ⭐Perfect centering (with auto-transform)Centered badges, symmetric layouts
75%3/4 across containerOff-center right alignment
100%Right/Bottom edgeEdge alignment (opposite side)
🎯 Automatic Centering with 50%

When you use 50% for Left or Right (horizontal centering) or Top or Bottom (vertical centering), WhoKnew Views automatically applies a CSS transform to perfectly center the counter:

/* You set: left: 50%; */
/* Plugin applies: */
.product-views-counter {
    left: 50%;
    transform: translateX(-50%); /* Auto-added for perfect centering */
}

This transform shifts the counter back by half its own width, placing its center point at the 50% mark (not its left edge). Without this transform, the counter’s left edge would be at 50%, making it appear off-center.

🎨 Centering Shortcut: Want a perfectly centered counter? Set top: 50%; left: 50%; and the plugin automatically applies transform: translateX(-50%) translateY(-50%); No manual CSS required—it just works!

🔄 Mixing Units

You can use different units for different axes. Each coordinate is independent:

Example MixResultUse Case
top: 20px; left: 50%;20px from top, horizontally centeredCentered top banner style
top: 10%; right: 15px;10% down from top, 15px from right edgeResponsive vertical, fixed horizontal
bottom: 25%; left: 0px;25% up from bottom, flush leftLower-left with vertical fluidity

🛠️ Common Positioning Recipes

These battle-tested coordinate combinations solve 90% of positioning needs. Copy them directly into your settings!

Recipe 1: Classic Top-Left (Default)

CoordinateValueUnit
Top Position0px
Left Position0px
Bottom Position(leave empty)auto
Right Position(leave empty)auto

Result: Counter flush with top-left corner of product image. Ultra-compact, maximum visibility.

Recipe 2: Professional Inset (Top-Left with Padding)

CoordinateValueUnit
Top Position15px
Left Position15px
Bottom Position(leave empty)auto
Right Position(leave empty)auto

Result: Counter 15px away from top and left edges. Balanced, professional spacing.

Recipe 3: Bottom-Right Corner

CoordinateValueUnit
Top Position(leave empty)auto
Left Position(leave empty)auto
Bottom Position10px
Right Position10px

Result: Counter in bottom-right corner, 10px inset. Subtle, unobtrusive, doesn’t block main product features.

Recipe 4: Centered Top (Horizontal Center)

CoordinateValueUnit
Top Position0px
Left Position50%
Bottom Position(leave empty)auto
Right Position(leave empty)auto

Result: Counter at top edge, horizontally centered. Banner-style placement. Auto-applies translateX(-50%) for perfect centering.

Recipe 5: Fully Centered (Badge Style)

CoordinateValueUnit
Top Position50%
Left Position50%
Bottom Position(leave empty)auto
Right Position(leave empty)auto

Result: Counter dead-center of product image. Eye-catching, symmetrical. Auto-applies translateX(-50%) translateY(-50%).

Recipe 6: Sticky Top-Right (Fixed Positioning)

CoordinateValueUnitNotes
Position ModeFixed(not Absolute)
Top Position20px20px from top of viewport
Left Position(leave empty)auto
Bottom Position(leave empty)auto
Right Position20px20px from right of viewport

Result: Counter stays in top-right corner of screen (not image) even when scrolling. Persistent social proof.


🔗 How Coordinates Interact with Other Settings

📱 Mobile Position Overrides

WhoKnew Views includes mobile-specific coordinate fields that mirror the desktop ones:

  • Mobile Top Position
  • Mobile Bottom Position
  • Mobile Left Position
  • Mobile Right Position

These fields are only visible when:

  1. Position is set to Absolute or Fixed (not Relative)
  2. Mobile Visibility is set to Show on Both
  3. Mobile Position Override checkbox is enabled

When enabled, you can set different coordinates for mobile devices. For example:

Screen SizeTopLeftUse Case
Desktop0px0pxTop-left corner on large screens
Mobile10px50%Centered top on small screens (better UX)

Mobile positioning overrides are covered in detail in a dedicated KB article.

🎨 Text Alignment Interaction

The Text Align setting (left/center/right) affects the internal layout of text and icon within the counter. Position coordinates affect the counter’s external placement on the image. They work together:

Position CoordinatesText AlignVisual Result
top: 0; left: 0;LeftCounter at top-left, content left-aligned
top: 0; left: 50%;CenterCounter centered horizontally, content centered
bottom: 10px; right: 10px;RightCounter at bottom-right, content right-aligned

🔲 Padding Interaction

Padding adds internal spacing inside the counter container. Position coordinates place the entire container (including padding). They’re additive:

Example:
- Top Position: 10px
- Padding: 5px 10px 5px 10px (top right bottom left)
Result: 
- Counter's outer edge is 10px from product image top
- Content inside counter has additional 5px top padding
- Total distance from image edge to content: 15px

🛠️ Troubleshooting Coordinate Issues

Issue 1: “My coordinates aren’t working at all”

Root Cause

You’re using Relative positioning, which disables manual coordinate controls.

✅ Solution
  • Change Position to Absolute or Fixed
  • The Top/Bottom/Left/Right fields will become active
  • Your coordinate values will now apply

Issue 2: “Counter appears in the wrong place”

Diagnosis Checklist
CheckWhat to Look For
Position ModeAbsolute (gallery-relative) vs Fixed (viewport-relative)?
Unit SelectionAre you using px or %? Check dropdown next to number
Opposing CoordinatesDid you set both Top and Bottom (or Left and Right)?
Empty FieldsFields with no value default to auto (disabled)
✅ Quick Fix
  • Reset to defaults: top: 0px; left: 0px; bottom: auto; right: auto;
  • Adjust from this known-good starting point

Issue 3: “Centering with 50% looks off-center”

Root Cause

This shouldn’t happen—the plugin auto-applies transform: translate for percentage values. If it does happen:

✅ Solution
  • Check if you have Custom CSS overriding the transform
  • Look for transform: rules in your Custom CSS field that might be conflicting
  • If using Custom CSS transforms, manually add translateX(-50%) or translateY(-50%) as needed

Issue 4: “Counter is cut off at edges”

Root Cause

Coordinates place the counter partially outside the container boundaries (common with 0px values when borders/padding exist).

✅ Solution
  • Increase coordinates to add padding: top: 10px; left: 10px; instead of 0px
  • Check Border Padding and Main Padding settings—they add to the counter’s footprint
  • If using border-radius, add extra coordinate padding to prevent clipping

Issue 5: “Mobile and desktop positions look identical”

Root Cause

Mobile Position Override is not enabled, so mobile uses desktop coordinates.

✅ Solution
  • Enable Mobile Position Override checkbox
  • The mobile coordinate fields will appear
  • Set different values for mobile (they auto-populate with desktop values initially)

Issue 6: “Negative values aren’t working”

Root Cause

Negative coordinates are supported and should work. If they don’t:

✅ Solution
  • Ensure you’re entering a negative number (e.g., -10) in the value field, not the unit dropdown
  • Check that Position is Absolute or Fixed (not Relative)
  • Clear browser cache—some themes aggressively cache CSS
  • Use Live Preview to test—it updates immediately without caching

📚 Technical Deep Dive: CSS Output

How WhoKnew Views Renders Coordinates

Understanding the CSS output helps with advanced troubleshooting and Custom CSS integration.

Example 1: Simple Pixel Positioning

Your Settings:

  • Position: Absolute
  • Top: 15 px
  • Left: 20 px
  • Bottom: (empty)
  • Right: (empty)

Generated CSS:

.product-views-counter {
    position: absolute;
    top: 15px;
    left: 20px;
    bottom: auto;
    right: auto;
}
Example 2: Percentage Centering

Your Settings:

  • Position: Absolute
  • Top: 50 %
  • Left: 50 %
  • Bottom: (empty)
  • Right: (empty)

Generated CSS:

.product-views-counter {
    position: absolute;
    top: 50%;
    left: 50%;
    bottom: auto;
    right: auto;
    /* Plugin auto-adds: */
    transform: translateX(-50%) translateY(-50%);
}
Example 3: Fixed Viewport Positioning

Your Settings:

  • Position: Fixed
  • Top: 20 px
  • Left: (empty)
  • Bottom: (empty)
  • Right: 30 px

Generated CSS:

.product-views-counter {
    position: fixed;
    top: 20px;
    left: auto;
    bottom: auto;
    right: 30px;
    z-index: 1000; /* Recommended for Fixed */
}
Example 4: Mobile Override

Your Settings:

  • Desktop: top: 0px; left: 0px;
  • Mobile Override: Enabled
  • Mobile: top: 10px; left: 50%;
  • Breakpoint: 768px

Generated CSS:

/* Desktop (default) */
.product-views-counter {
    position: absolute;
    top: 0px;
    left: 0px;
    bottom: auto;
    right: auto;
}
/* Mobile (below breakpoint) */
@media (max-width: 768px) {
    .product-views-counter {
        top: 10px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

🔍 Validation Rules

The plugin sanitizes and validates coordinate inputs:

InputValidationResult
15 + px✅ ValidSaves as 15px
50 + %✅ ValidSaves as 50%
-10 + px✅ Valid (negative allowed)Saves as -10px
2.5 + px✅ Valid (decimals allowed)Saves as 2.5px
(empty) + any unit✅ ValidSaves as auto (disabled)
abc + px❌ Invalid (not numeric)Reverts to default (0 or auto)
15 + em❌ Invalid (em not supported)Reverts to default

💡 Technical Note: The plugin uses a split-field format internally (top_position_value + top_position_unit) for maximum flexibility, then combines them into CSS-ready strings (15px, 50%) for output. This ensures proper sanitization and prevents malformed CSS.


🎓 Best Practices & Pro Tips

✅ Do’s

  • Start with 0px defaults, then adjust in 5px or 10px increments while watching live preview
  • Use 15-20px insets for professional spacing (avoids edge-bleeding)
  • Use 50% for centering (auto-transforms applied—no manual CSS needed)
  • Set Bottom/Right to auto (or leave empty) when using Top/Left coordinates
  • Test on mobile after setting coordinates—small screens may need different placement
  • Use pixels for precision, percentages for responsive/fluid layouts
  • Document your coordinates in Custom CSS comments if using complex positioning

❌ Don’ts

  • Don’t set both Top and Bottom (or Left and Right) to non-auto values simultaneously
  • Don’t use 0px with borders—the counter may clip at edges (use 10-15px instead)
  • Don’t forget to check Position mode—Absolute and Fixed use different coordinate systems
  • Don’t use percentage centering without understanding transforms—it’s automatic, but knowing why helps debugging
  • Don’t rely solely on coordinates for spacing—use Padding and Border Padding too
  • Don’t forget auto disables an axis—empty fields = auto

🎯 Golden Rule: The default top: 0px; left: 0px; bottom: auto; right: auto; is your reset point. If positioning goes wrong, return to these values and adjust incrementally. Use live preview to see changes in real-time—no save required.


🔗 Related Articles

  • Absolute vs Relative vs Fixed Positioning: Understand the three positioning modes before setting coordinates
  • Mobile Position Overrides: Set different coordinates for mobile devices (dedicated article with full details)
  • Z-Index & Layer Management: Control which elements appear on top when counters overlap
  • Padding & Spacing: Fine-tune internal spacing within your positioned counter
  • Custom CSS: Advanced coordinate techniques (calc() functions, viewport units, transforms)

🚀 Next Steps: With coordinate mastery achieved, the next article (Z-Index & Layer Management) teaches you how to control stacking order—which elements appear on top when counters overlap with product images, badges, or other theme elements. Complete positioning control = Coordinates + Layers.

Share