Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

XHTML - create my own elements?

  • 13-07-2007 1:15pm
    #1
    Registered Users, Registered Users 2 Posts: 2,364 ✭✭✭


    Can you have your own elements in XHTML?

    Say I make up a tag <mytag> so I can easily modify its properties using CSS, do I have to tell the XHTML somewhere that I've made this tag, or is it just not allowed?


Comments

  • Registered Users, Registered Users 2 Posts: 26,584 ✭✭✭✭Creamy Goodness


    what you're looking for would be classes in css.

    xHTML doesn't allow the making up of your own tags.


  • Registered Users, Registered Users 2 Posts: 2,364 ✭✭✭Mr. Flibble


    Ah, right. Cheers.


  • Registered Users, Registered Users 2 Posts: 706 ✭✭✭DJB


    Best give a <div> tag an id and then in css, you can use #whateveridis to modify it's properties. Similar to classes but id's are unique to one element and classes can be applied to multiple elements on the one page.

    Rgds, Dave


  • Registered Users, Registered Users 2 Posts: 2,364 ✭✭✭Mr. Flibble


    I want to control the style of a number of elements (for questions and answers in FAQ here) so using class is best right?

    While we are all here, can somone verify the following for me.
    - one or more elements can have the same class name but only one element can have a particular ID?

    - to access an ID in css you use #theid and to access a class you use .theclass?

    - and to only specify particular id classes you would do #theid theid2 or #theid theclass2 for IDs and theclass.theid or theclass.theclass2 ?
    So a space for IDs and a . for classes?


  • Registered Users, Registered Users 2 Posts: 11,989 ✭✭✭✭Giblet


    Use XML and a dtd to make your own elements.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,364 ✭✭✭Mr. Flibble


    what you said

    my head


  • Registered Users, Registered Users 2 Posts: 21,263 ✭✭✭✭Eoin


    For the FAQ section, you could use something like this:

    [html]
    <style type="text/css">
    dt
    {
    /* same definitions as your question class */
    }

    dd
    {
    /* same definitions as your answer class */
    }
    </style>

    <dl>
    <dt>Your question here</dt>
    <dd>Your Answer here</dd>
    <dt>Another question here</dt>
    <dd>Another Answer here</dd>
    </dl>
    [/html]

    I think this might make better / more semantic markup as it associates a question with an answer, while using <li> tags doesn't.


  • Registered Users, Registered Users 2 Posts: 2,364 ✭✭✭Mr. Flibble


    Ok, I tried to do that. Can I put lists inside the answers tho? I seem to get errors when I do.


Advertisement