Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Intelligence View
⚡ tsecurity.de Intelligence

Functional tabs with only CSS (No JavaScript)

This article demonstrates how to create functional tabs using only CSS, without any JavaScript. The tabs will allow users to switch between different content sections seamlessly, showcasing the power of CSS for interactive elements.…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

This article demonstrates how to create functional tabs using only CSS, without any JavaScript. The tabs will allow users to switch between different content sections seamlessly, showcasing the power of CSS for interactive elements.

Original article: wtfcodes.com





Basic setup:



To get started, we will create a typical HTML structure for our tabs and apply some basic styles to make them visually appealing.




<div class="tabs-wrapper">  
<nav class="tabs-nav">
<div class="tab-item">
<span>Tab A</span>
</div>
<div class="tab-item">
<span>Tab B</span>
</div>
<div class="tab-item">
<span>Tab C</span>
</div>

</nav>

<div class="tab-content" id="tab-a-content">
I am Tab A content
</div>
<div class="tab-content" id="tab-b-content">
I am Tab B content
</div>
<div class="tab-content" id="tab-c-content">
I am Tab C content
</div>
</div>









body{
font-family: Arial;
padding: 1em;
}

.tabs-nav{
display: flex;
gap: 8px;
margin-bottom: 16px;
user-select: none;
}

.tab-item{
background: #bcbcbc;
padding: 6px 12px;
border-radius: 6px;
color: #fff;
cursor: pointer;
}
.tab-content{
padding: 12px;
border-radius: 16px;
border: 1px solid grey;
}






Basic setup result



Great! Now we need somekind of interactivity.

Lets think what cab we do so the active tab has something different than other tabs.

Well we can use <input type="radio" /> to indicate the active tab. Since radio inputs allow only one to be selected at a time, we can use them to control which tab is active.

And to make sure we can toggle the radio inputs by clicking on the tab, we can use the <label> element instead of <div> for the tab items.

So the updated HTML structure will look like this:




<div class="tabs-wrapper">  
<nav class="tabs-nav">
<label for="tab-a-toggle" class="tab-item">
<span>Tab A</span>
<input checked name="tabs-toggle" id="tab-a-toggle" type="radio">
</label>
<label for="tab-b-toggle" class="tab-item">
<span>Tab B</span>
<input name="tabs-toggle" id="tab-b-toggle" type="radio">
</label>
<label for="tab-c-toggle" class="tab-item">
<span>Tab C</span>
<input name="tabs-toggle" id="tab-c-toggle" type="radio">
</label>
</nav>

<div class="tab-content" id="tab-a-content">
I am Tab A content
</div>
<div class="tab-content" id="tab-b-content">
I am Tab B content
</div>
<div class="tab-content" id="tab-c-content">
I am Tab C content
</div>
</div>






Updated html structure

Nice progress!

Since we don't want the radio inputs to be visible, we can hide them using .tab-item input{display: none; } in the CSS.





Highlight the active tab:



We can use the tab-item:has(input:checked) selector in CSS to check if a tab has a checked input and apply styles to it.




.tab-item input{
display: none;
}
.tab-item:has(input:checked){
background: #6b54f0;
}






Active tab visible

Amazing! Now we can see which tab is active.

Using the same logic, we can also show/hide the content of the active tab.




.tab-content{
display: none;
}
.tabs-wrapper:has(#tab-a-toggle:checked) #tab-a-content{
display: block;
}
.tabs-wrapper:has(#tab-b-toggle:checked) #tab-b-content{
display: block;
}
.tabs-wrapper:has(#tab-c-toggle:checked) #tab-c-content{
display: block;
}






Final result






Final code:






<div class="tabs-wrapper">  
<nav class="tabs-nav">
<label for="tab-a-toggle" class="tab-item">
<span>Tab A</span>
<input checked name="tabs-toggle" id="tab-a-toggle" type="radio">
</label>
<label for="tab-b-toggle" class="tab-item">
<span>Tab B</span>
<input name="tabs-toggle" id="tab-b-toggle" type="radio">
</label>
<label for="tab-c-toggle" class="tab-item">
<span>Tab C</span>
<input name="tabs-toggle" id="tab-c-toggle" type="radio">
</label>
</nav>

<div class="tab-content" id="tab-a-content">
I am Tab A content
</div>
<div class="tab-content" id="tab-b-content">
I am Tab B content
</div>
<div class="tab-content" id="tab-c-content">
I am Tab C content
</div>
</div>









body{
font-family: Arial;
padding: 1em;
}

.tabs-nav{
display: flex;
gap: 8px;
margin-bottom: 16px;
user-select: none;
}

.tab-item{
background: #bcbcbc;
padding: 6px 12px;
border-radius: 6px;
color: #fff;
cursor: pointer;
}
.tab-content{
padding: 12px;
border-radius: 16px;
border: 1px solid grey;
}

.tab-item input{
display: none;
}
.tab-item:has(input:checked){
background: #6b54f0;
}

.tab-content{
display: none;
}

.tabs-wrapper:has(#tab-a-toggle:checked) #tab-a-content{
display: block;
}
.tabs-wrapper:has(#tab-b-toggle:checked) #tab-b-content{
display: block;
}
.tabs-wrapper:has(#tab-c-toggle:checked) #tab-c-content{
display: block;
}









Thank you for reading!



If you enjoyed this article, please consider sharing it with others.

You can support me on Buy Me a Coffee.

If you have any feedback or suggestions, feel free to reach out to me on Twitter.

Don't forget to checkout wtfcodes.com

1. Sofort-Triage & Abwehrmaßnahmen

SOC Incident Playbook: Vulnerability Remediation & Verification
Syntax validiert (0 Fehler)
title: Detect Exploitation - Functional tabs with only CSS (No JavaScript)
id: 187985c7-bc17-402e-8f64-eb80f312c297
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-27
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-27"
        description = "YARA Signature for "
    strings:
        $str = "Functional tabs with only CSS " ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("Functional tabs with only CSS No JavaScr")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*Functional tabs with only CSS No JavaScr*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "Functional tabs with only CSS No JavaScr"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc

2. Cyber Threat Intelligence & Forensik

🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Analyse für identifizierte Bedrohung auf Basis von Live-CTI (ENISA EUVD): CVSS 0.0 · EPSS 0.0% · CISA KEV: nein. Handlungsableitung aus den verlinkten Hersteller-Quellen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Functional tabs with only CSS (No JavaScript)

Thematisch verwandte Begriffe: Functional, tabs, with, only · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
ZERO-DAY CVE-2025-71424 | Contrast, Edgeless Systems' runtime for confidential containers on Kuber…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag