Hello can someone post an example of using ID in webflow, cause I had only use classes and havnt got any idea for the ID.
Hi @lestergonzales, the ID is a unique id that you can optionally assign to any element on your page. As an example, if you have a three sections, and you give each section unique IDs A, B and C, when you go to create a nav menu on your page, you can select those sections to navigate to, by their unique ID you have set for each section.
Another example, is if you are trying to do something in code, jQuery for example, then you can refer to an element by it’s unique ID:
This notation above would refer to the element on your page with ID = A. With code, you can refer to elements by unique ID or by class name.
Another example, might be if you are trying to link from one section on one page, to another section on another page, where your url might be something like:
Where A is the unique ID of the section you are trying to link to. I hope these examples help. You can always do an internet search on different ways to use the html unique ID of an element. Cheers, Dave
Or was @lestergonzales asking about “how to set an ID name (”#") to an element instead of a class name? Often, you want to use a JS script you’ve found somewhere but it would only work with #IDs, not .classes. (That’s the only reason I know for being limited by WF because of no ID)
Hi @vincent, well there is no limitation One can use ID or one can use Class Name in code, it all depends on how the code is written and what it is expecting.
Probably the number one reason people set the unique ID is for section navigation.
Ah, @cyberdave, you’re gonna make fun of me, reading you I just only realise, right now, that WF Unique IDs turn to… IDs in the code. I was under the impression that they were just for in page linking.
(Also I may or may not have told a bunch of people they couldn’t put #IDs in WF…)
Hehe @vincent, don’t beat yourself up to much Now you know and we all learn something new all the time, I still learn new ways to use Webflow
Thanks Sir. for the information