← HTML + CSS

Spoiler em html

Lida 8512 vezes

Offline

RAZerart 
Membro
Mensagens 26 Gostos 0
Troféus totais: 20
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 4 Level 3 Level 2 Level 1 10 Posts First Post

Como faço um spoiler em html?


Offline

dementor4842 
Membro
Mensagens 471 Gostos 0
Troféus totais: 25
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 100 Posts

Da mais informações do que queres por favor
Offline

davids 
Membro
Mensagens 217 Gostos 0
Feedback +2

Troféus totais: 24
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 4 Level 3 Level 2 Level 1 100 Posts

Código: [Seleccione]
<html>
<head>
    <title>Spoiler HTML code</title>
    <style type="text/css">
body,input
    {
    font-family:"Trebuchet ms",arial;font-size:0.9em;
    color:#333;
    }
.spoiler
    {
    border:1px solid #ddd;
    padding:3px;
    }
.spoiler .inner
    {
    border:1px solid #eee;
    padding:3px;margin:3px;
    }
    </style>
    <script type="text/javascript">
function showSpoiler(obj)
    {
    var inner = obj.parentNode.getElementsByTagName("div")[0];
    if (inner.style.display == "none")
        inner.style.display = "";
    else
        inner.style.display = "none";
    }
    </script>
</head>
<body>
<h1>Spoiler HTML w/Js Code by Skrap</h1>
<div class="spoiler">
    <input type="button" onclick="showSpoiler(this);" value="Show/Hide" />
    <div class="inner" style="display:none;">
    This is a spoiler!
    </div>
</div>
</body>
</html>
http://skrap.nar.co.il/spoiler.html

Ve lá se isto serve!
Offline

RAZerart 
Membro
Mensagens 26 Gostos 0
Troféus totais: 20
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 4 Level 3 Level 2 Level 1 10 Posts First Post

E isso mesmo, obrigado!