SitePoint Sponsor |
|
User Tag List
Results 1 to 8 of 8
Thread: new tag
-
Mar 29, 2007, 10:50 #1
new tag
Hi,
I would like to create new tags... like :
<rounddiv width="300px" style='background-color:#A090FF;'> ... </rounddiv>
when browser will encounter such tag, it should directly use/run a js function which should create such "div".
how can i do that ?
thx.
M.
-
Mar 29, 2007, 10:55 #2
- Join Date
- Sep 2005
- Location
- Tanzania
- Posts
- 4,662
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
You shouldn't have tags that the browser won't understand.
Instead of the browser "encountering" such a tag, it would be best to create this div you want when the page has finished loading, like this:
Code:window.onload = function() { var d = document.createElement('div'); d.style.width = '300px'; d.style.backgroundColor = '#A090FF'; d.appendChild(document.createTextNode('The text you want in the div')); document.body.appendChild(d); }
It's unclear what you mean by the browser "encountering" this tag. What do you mean?
-
Mar 29, 2007, 11:19 #3
i mean that when browser read/load html file and find a <div> tag, it knows what it has to do with and how to read the options like width, style, ...
i would like to have the same with my tags.
-
Mar 29, 2007, 11:47 #4
- Join Date
- Sep 2005
- Location
- Tanzania
- Posts
- 4,662
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
This in the realm of XML, you would have to add an extra namespace. This wouldn't be very cross-browser. It wouldn't work in internet explorer, for example. What would be better is if you do something like this:
HTML Code:<div class="round">...</div>
-
Mar 30, 2007, 00:06 #5
In fact, i would like to have some tag which will create some rounded DIV corner, with maybe some border and gradient options.
I would like to base my work on what i've read about those topics and to make a full and working tag.
M.
-
Mar 30, 2007, 01:14 #6
- Join Date
- Jan 2005
- Location
- Too far up north
- Posts
- 1,566
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
What topics would those be?
-
Mar 31, 2007, 01:11 #7
round div with border
-
Mar 31, 2007, 01:29 #8
- Join Date
- Jan 2005
- Location
- Too far up north
- Posts
- 1,566
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ok... would be interesting to see how you create this "new" tag.
Bookmarks