Rohit Bajaj
asked on
Using custom html tags with differnt name but exact styling as existing ones
Hi,
I am using <ul> , <li> tags in my javascript library. This will be used by some user.. My library also has styling info for ul and li tags...
What this library does is if a user has an html element like : <div id="filter"/>
It will replace it with some new html consisting of <ul> . <li> etc... tags...
This only happens when the user passes the id of the html element to my library.
But the issue with this is that my library has a particular css included with a particular styling for ul and li element.. which i want to use for this replaced html...
But in case if user also specifies the style for ul and li elements then that may interfere with my library styling.
So i was thinking if instead of specifying ul i could specify something like <temp:ul> ie. my custom name but has the same styling as ul. So if user provides some styling for ul it doesnt override my styling.
Is there any way to achieve this ?
Thanks
I am using <ul> , <li> tags in my javascript library. This will be used by some user.. My library also has styling info for ul and li tags...
What this library does is if a user has an html element like : <div id="filter"/>
It will replace it with some new html consisting of <ul> . <li> etc... tags...
This only happens when the user passes the id of the html element to my library.
But the issue with this is that my library has a particular css included with a particular styling for ul and li element.. which i want to use for this replaced html...
But in case if user also specifies the style for ul and li elements then that may interfere with my library styling.
So i was thinking if instead of specifying ul i could specify something like <temp:ul> ie. my custom name but has the same styling as ul. So if user provides some styling for ul it doesnt override my styling.
Is there any way to achieve this ?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Bottom line... There is no technique you can come up with that a coder with decent HTML, CSS, and Javascript knowledge cannot bypass, circumvent, or override if they really want to. Most people won't want to use a library or framework that uses inline styles when CSS options are being ignored.
You seem to be over constraining the problem. What are the requirements that are forcing you to use inline styles?
You seem to be over constraining the problem. What are the requirements that are forcing you to use inline styles?
ASKER
I am including a css in my js file... My js file basically provide a search filter widget with some styling. And this styling is bundled with my js file...
What other alternative ways do you suggest can i achieve this ?
What other alternative ways do you suggest can i achieve this ?
ASKER
if the user puts some styling on ul tag then that wilp reflect on my ul tag also