/    Sign up×
Community /Pin to ProfileBookmark

Hide text in a box using width 0?

Is it possible to “hide” the text and the box using CSS `width: 0px;`?

https://jsfiddle.net/qf78tved/

to post a comment
CSS

6 Comments(s)

Copy linkTweet thisAlerts:
@SempervivumNov 17.2022 — Yes, this is possible by adding `overflow: hidden</C> to <C>nav`.
Copy linkTweet thisAlerts:
@sibertauthorNov 17.2022 — @Sempervivum#1648538

Spot on as usual :-)
Copy linkTweet thisAlerts:
@cootheadNov 17.2022 — Hi there sibert,

If you are interested, this can also be achieved without [i]"JavaScript"[/i]

https://jsfiddle.net/bqdxcgno/

[i]coothead[/i]
Copy linkTweet thisAlerts:
@semlatopasNov 18.2022 — You can apply CSS width:0px; to the tag and the element will be hidden.
Copy linkTweet thisAlerts:
@sibertauthorNov 18.2022 — > @semlatopas#1648550 You can apply CSS width:0px; to the tag and the element will be hidden.

But the text will not hide :-)
Copy linkTweet thisAlerts:
@cootheadNov 18.2022 — Hi there sibert,

here is a slightly better CSS example - ( does not use [b]::before [/b] )...

https://jsfiddle.net/0L3gnw12/

[i]coothead[/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.27,
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,
)...