+ 6
Need some help for the html code
please help me , why does the contents appear when the page is loaded and how do i only make it visible when i click on the buttons https://code.sololearn.com/WHB0W6Q0pv8W/?ref=app
6 Antwoorden
+ 12
Add this CSS inside <style> :
.tabcontent{display:none;}
+ 12
It shows after click.
+ 6
yes it worked ty
+ 4
but then it doesnt show any content
+ 4
i had used visibility :hidden
+ 4
this example is from w3schools and the one you are trying is simple which will do appear only when you click it it happens there too. to make one tab visible you have to make one active see their next example where they make one tab active and try that. for here you can add JavaScript click () method to automatically click in tab and it will become active.
or make in css first-child{display:block} or you can change style="..." but then it need change in js to element.style.display instead of classes