(This is my own site visit count.)
WIDGETS
Visitor Counter Widget
Click To Go Back To The Widgets PagePreview
About
This is a visitor counter widget for Neocities users. It simply gets the "views" data of target user and displays it.
This widget is based on a tutorial here: https://dannarchy.com/tut/tut_002
Proxy errors fixed using this guide: https://pastebin.com/raw/dw7s2Th3
Version: 4.0
File (iFrame page) Size: 1.92KB
How To Add?
Adding the widget:
Insert this iFrame line between <body> and </body>.
<iframe src="https://404city.neocities.org/widget/visitorCounterV4?sitename=YOUR_SITENAME_HERE&css=YOUR_VISITOR_COUNTER_CSS_FILE_URL_HERE" width="300" height="100" frameborder="0" scrolling="no" title="Visitor Counter"></iframe>- After that, replace the YOUR_SITENAME_HERE placeholder with your own Neocities sitename. Example => ?sitename=404city
- The visitor count will be displayed on this iFrame.
Styling it with CSS:
- To add custom styling to your widget's iFrame content, create a new CSS file on your site (for example, visitorCounter.css) for the widget's stylesheet.
- Then, replace the YOUR_VISITOR_COUNTER_CSS_FILE_URL_HERE placeholder in your iFrame source with your CSS file's URL.
Example => &css=https://mysite.neocities.org/css/visitorCounter.css - You can stylize your widget with these ID selectors:
| ID | Element Type | Description |
|---|---|---|
| #visitorCounterDisplay | body | Displays visit count. |
| #visitorCounterDisplay::before | pseudo-element | "You are visitor:" text. |
Default CSS Definitions
These are the default CSS properties of elements that already defined in your widget iFrame content:
body {
margin: 0;
overflow: hidden;
}
body, html {height: 100%;}
:where(#visitorCounterDisplay){
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
font-size: 3rem;
font-family: Arial, Helvetica, sans-serif;
user-select: none;
box-sizing: border-box;
border: 1px solid #000;
}
:where(#visitorCounterDisplay)::before {
content: "You are visitor:";
font-size: 1rem;
box-sizing: border-box;
}
HTML Structure
The visual part of the HTML inside the iFrame:
<body id="visitorCounterDisplay">######</body>
Update Log
18 July 2026, Saturday
- Added "css" parameter to iFrame URL to make CSS file hotlinking more flexible.
24 June 2026, Wednesday
- Replaced script and internal CSS system with a simpler sitename based parameter system and an external CSS loading.
21 June 2026, Sunday
- Fixed Proxy server errors.
2 May 2026, Saturday
- Updated widget with an iFrame system to fix CSP errors.
3 January 2026, Saturday
- Removed thousands separator from visitor display
14 November 2025, Friday
- Widget is ready to use!
Click To Go Back To The Widgets Page