Artifacts Gallery Guilds Search Wiki Login Register

Welcome, Guest. Please login or register. - Thinking of joining?
Autumn, 29 Oct 2026 - @6.76
Forum Activity: Four Stars Random | Recent Posts | Guild Recents
News: It's the silly things you'll remember :trash: Guild Events: TIME FOR HALLOWEEN CRAFTS!
Super News: ~~MelonLand's Halloween Profile Design Contest 2026~~
+  MelonLand Forum
|-+  Da Web Revival
| |-+  ✁ ∙ Web Crafting
| | |-+  ☔︎ ∙ I need Help!
| | | |-+  Digital Garden Topography in Basic HTML/CSS


« previous next »
Pages: [1] Print Embed
Author Topic: Digital Garden Topography in Basic HTML/CSS  (Read 1424 times)
thearistocats
Casual Poster ⚓︎
*
View Profile WWW


⛺︎ My Room
RSS: RSS

Artifacts:
Joined 2025!
« on: Spring, 24 May 2025 @113 » Embed

Static site digital gardeners, I need your advice!

I am just in the beginning stages of creating a digital garden on my page. I don't have anything live for it yet because I can't seem to conceptualize how to have a garden-like topography with just basic HTML/CSS. I'd like to have some kind of tagging system, but I don't really know where to start with that. It feels like there should be a way to give elements in HTML a particular class (like a tag) and then be able to filter/view only certain tags, but I have no idea if this is possible with just HTML and CSS. Does anyone have any recommendations on what I should be looking for? I am still an HTML and CSS novice, and I can't really figure out how to search for this and find anything usable.

Thanks!

« Last Edit: Spring, 24 May 2025 @843 by thearistocats » Logged

find me on lovethea.net, your premier source for all thea related news

she/it
edea
Casual Poster ⚓︎
*
View Profile WWW


⛺︎ My Room
Itch.io: My Games

Guild Memberships:
Artifacts:
Joined 2025!
« Reply #1 on: Spring, 24 May 2025 @688 » Toggle Font Embed

Heya, I don't know if this is possible using PURELY HTML/CSS, but it's VERY possible once you mix in some basic Javascript (which is usable pretty much anywhere you can use HTML/CSS, even static site hosts)!
You can do this with some checkboxes and a button that triggers a JS function. Consider this example:
Code
<div id="checkbox-container">
  <label> 
    Show Blue Elements
    <input type="checkbox" id="blue-elem-check" name="blue-elem-check" value="Blue" checked>
  </label>
  <label> 
    Show Red Elements
    <input type="checkbox" id="red-elem-check" name="red-elem-check" value="Red" checked>
   </label>
   <label> 
     Show Yellow Elements
     <input type="checkbox" id="yellow-elem-check" name="yellow-elem-check" value="Yellow" checked>
   </label>
   <button type="button" onclick="colorFilter()">Filter</button>
</div>
<div class="blue"></div>
<div class="yellow"></div>
<div class="red"></div>
<div class="blue"></div>
<div class="yellow"></div>
<div class="red"></div>
And this CSS to style it:
Code
#checkbox-container {
  display: flex;
  flex-direction: column;
  margin-bottom: 50px;
}
    		
.checkbox-container label {
  padding-bottom: 5px;
}
    		
.checkbox-container button {
  width: 80px;
}
    		
.blue, .red, .yellow {
  width: 50px;
  aspect-ratio: 1 / 1;
}
    		
.blue {
  background-color: blue;
}
    		
.red {
  background-color: red;
}
    		
.yellow {
  background-color: yellow;
}
With this, you'll end up with a page looking like this, with checkboxes for each type of element, then the elements themselves.
https://i.ibb.co/d0cXVmNd/IMG-0624.jpg
When you click the Filter button, it will call a javascript method "colorFilter()". We can write that method as such:
Code
function colorFilter() {
  var showBlue = document.getElementById("blue-elem-check").checked;
  var showRed = document.getElementById("red-elem-check").checked;
  var showYellow = document.getElementById("yellow-elem-check").checked;
				
  var blueElements = document.getElementsByClassName("blue");
  var redElements = document.getElementsByClassName("red");
  var yellowElements = document.getElementsByClassName("yellow");
				
  for (var i = 0; i < blueElements.length; i++) {
    var currentElement = blueElements[i];
    if (showBlue == true) {
      currentElement.style.visibility = "visible";
    }
    else {
      currentElement.style.visibility = "hidden";
    }
  };
  ...[Repeat for loop for the other colors, changing the variable names for each class you have]				
}
With this, by checking and unchecking each type of element (denoted by their html class attribute) then hitting the Filter button, you can toggle visibility for any number of categories. You can then go on to style this and add CSS animations if you want the hiding and showing to be a bit prettier.
If you wanna mess with it, here's a JSFiddle you can use to test it and try other styling or adding images: https://jsfiddle.net/r4nd2zhy/1/

Logged

https://i.ibb.co/GQ5RrcYq/Edea-s-Space-Between.png
https://i.ibb.co/Kc8rkNQW/IMG-0625.gif
https://i.ibb.co/9mfP6q1Z/IMG-0627.webp
https://i.ibb.co/kqqLRkr/EDEA-DENSA.gif
https://i.ibb.co/Ngj8HPpM/IMG-0626.jpg
thearistocats
Casual Poster ⚓︎
*
View Profile WWW


⛺︎ My Room
RSS: RSS

Artifacts:
Joined 2025!
« Reply #2 on: Spring, 28 May 2025 @118 » Embed

Thank you very much for such an in-depth answer! I tinkered with it a bit and got something pretty close working on a local test site. Very much appreciated!

Logged

find me on lovethea.net, your premier source for all thea related news

she/it
Pages: [1] Print Embed 
« previous next »
 

Melonking.Net © Always and ever was! SMF 2.0.19 | SMF © 2021 | Privacy Notice | Send Feedback | Supporters ♥ Forum Guide | Rules | RSS | WAP | Mobile


MelonLand Badges and Other Melon Sites!

MelonLand Project! Visit the MelonLand Forum! Support the Forum
Visit Melonking.Net! Visit the Gif Gallery! Pixel Sea TamaNOTchi
@000 Melon
Land
Forum Art Hub Chat Webring Explore Random Recent Tenement Arcade Want to Login or Join ? Web Craft Guide Graphic Catalogue Wiki Help I'm Lost! Link Land Newsletters Image Stream Minecraft: Online
Zap!
Passport Sites tamaNOTchi Asatte Add your site?
Aero Archive Onio Cafe 32 Bit Cafe Status Cafe