/    Sign up×
Community /Pin to ProfileBookmark

Select a default button in a simple way

I am trying to select a default button (without javascript).

>

https://jsfiddle.net/7549j3sp/1/

It must be a simpler way to achieve this. Any tip?

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@daveyerwinJul 23.2019 — ``<i>
</i>&lt;style&gt;
.tabnav {
display: flex;
background-color: #fff;
flex-direction: row;
width: 100%;
}

.tabbtn {
font-weight: 400;
background-color: #f0f0f0;
color: #111;
cursor: pointer;
width: 100%;
display: block;
border: none;
text-align: left;
font-size: 18px;
padding: 10px;
}


input[type=radio]{position:absolute;left:-1000px}
input[type=radio]:checked ~ a {background-color: #2666ae;
color: white;}
&lt;/style&gt;
&lt;div class="tabnav"&gt;
&lt;label&gt;&lt;input type=radio name=rb&gt;
&lt;a class="tabbtn"&gt;Step 1&lt;/a&gt;&lt;/label&gt;
&lt;label&gt;&lt;input type=radio name=rb&gt;
&lt;a class="tabbtn"&gt;Step 2&lt;/a&gt;&lt;/label&gt;
&lt;label&gt;&lt;input type=radio name=rb&gt;
&lt;a class="tabbtn"&gt;Step 3&lt;/a&gt;&lt;/label&gt;
&lt;/div&gt;<i>
</i>
``
×

Success!

Help @sibert spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...