MAMEWorld >> The Loony Bin
View all threads Index   Flat Mode Flat  

Mr. DoAdministrator
MAME Art Editor
Reged: 09/21/03
Posts: 4876
Loc: California
Send PM
Neat... learned new HTML today... link to any text on a webpage
02/15/24 09:55 PM


You can link to specific text on a webpage, even if the page doesn't have an anchor in the page code for the text you want to link to.

Just add #:~:text= to the end of the normal link of the page

For example, this navigates directly to the artwork file for Mr. Do, and highlights it (and looks like I should update the CSS for highlighting for my site).

https://mrdo.mameworld.info/mame_artwork_ingame.php#:~:text=mrdo

This isn't so much for a page designer of the site in question... they would still use an anchor... this is more for someone that wants to link to something on another website that is not theirs, or for if you want to send a link to a friend, and direct them to a particular part of that page.

Note that for spaces, you have to add the "%20" in lieu of the space for phrases of words to work, like below link, will go to "Time Pilot"

https://mrdo.mameworld.info/mame_artwork_ingame.php#:~:text=Time%20Pilot

For complete specs... check link below. (And looks like I'm a bit behind... this feature was introduced 3.5 years ago).

https://web.dev/articles/text-fragments



RELAX and just have fun. Remember, it's all about the games.








Entire thread
Subject Posted by Posted on
* Neat... learned new HTML today... link to any text on a webpage Mr. DoAdministrator 02/15/24 09:55 PM
. * Don’t use Chrome-only features Vas Crabb  02/16/24 03:54 PM
. * Wasn't planning to... Mr. DoAdministrator  02/16/24 08:55 PM
. * Re: Neat... learned new HTML today... link to any text on a webpage Robbbert  02/16/24 05:44 AM
. * Re: Neat... learned new HTML today... link to any text on a webpage cyberdman  02/17/24 04:42 PM
. * Re: Neat... learned new HTML today... link to any text on a webpage Mr. DoAdministrator  02/16/24 11:39 AM
. * Re: Neat... learned new HTML today... link to any text on a webpage cyberdman  02/16/24 01:01 AM

Extra information Permissions
Moderator:  GatKong 
0 registered and 219 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 219