Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Oct 2003
    Location
    SC
    Posts
    936
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Random XML in the document....

    Can i just randomly define a new tag in my document, which i associate a css to, even if the rest of my document is in XHTML....?

    thanks

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Newcastle, England
    Posts
    178
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I think the answer is that if your document has an XHTML DOCTYPE then it is restricted to the tags and attributes which are defined in the HTML 4.01 specification.

    patrick

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can do it if you define your elements and attributes in addition to the XHTML DTD, although there are practical issues with that - http://www.codingforums.com/showthread.php?t=11384

    But stupid-IE problems aside, yeah of course you can - that's what the "X" in "XHTML" is all about
    Last edited by brothercake; 04-25-2004 at 03:56 AM.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #4
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You don't need to change the DTD:
    Code:
    <mymarkup:rootel xmlns:mymarkup="http://any.uri.will.do.here/">
      <mymarkup:childel />
      <mymarkup:childel />
    </mymarkup:rootel>
    You can then apply some CSS:
    Code:
    @namespace mymarkup "http://any.uri.will.do.here/";
    
    rootel { border: 1px solid blue }
    childel::after { content "hey there!" }
    /*if you've used @namespace to declare a namespace, you can then do this:*/
    mymarkup|rootel { /* rules */ }
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

  • #5
    Regular Coder
    Join Date
    Oct 2003
    Location
    SC
    Posts
    936
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks alot, LOL, im not really that much into xml yet, I hardly know what it is yet.... But thanks, all I was refering to is add a random tag like:

    <DoesThisWork>Hello</DoesThisWork>

    and then format it in css:

    DoesThisWork{
    font-size: 44px;
    }

    thanks again..


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •