How to Create your own HTML Tags in CSS

Discussion in 'Web Design & Coding' started by ~2C~, Nov 30, 2003.

  1. ~2C~

    ~2C~ Guest

    Just wondering,

    How do I create myown HTML tags.

    For example, whenever you use ur own custom tag such as <name> it goes to the CSS file and looks for the defning class, and does it. Cause right now when I try and od that it doesn't recognize it so it just comes out as <name>JOHNNY SMITH</name> as the output.. instead of JOHNNY SMITH in the right format.

    ANy ideas?:(
     
  2. j79zlr

    j79zlr Glaanies script monkey Political User

    Messages:
    2,725
    Location:
    Chicago
    I think your mistaken, you need to define either a class or an id, ie:

    Code:
    <html>
    <head>
    <style>
    .red {
        color : #ff0000;
    }
    
    #blue {
        color : #0000ff; 
    }
    </style>
    </head>
    <body>
    <div class='red'>This text is red as defined by the css class .red</div>
    <div id='blue'>This text is blue as defined by the css id #blue</div>
    </body>
    </html>
     
  3. Grandmaster

    Grandmaster Electronica Addict Political User Folding Team

    Messages:
    10,574
    Location:
    Santa Clara, CA
    Yes, what j79zlr said. :)
     
  4. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    yep what they said

    if you want to create your own tags then you are looking at XML, and then XSLT stylesheets and a whole new set of headaches.
    I have written a few XML DocTypes and those are not the nicest things to try and work out
     
  5. X-Istence

    X-Istence * Political User

    Messages:
    6,498
    Location:
    USA
    I am with Geffy on this one.