#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Posts
    62
    Rep Power
    12

    New to css: are u limited to tags in html


    Hi there,
    im just learning css now and im wondering if its possible to do this somehow:


    <myOwntagName style="font size: small; color: red; font-weight: bold; font-family: Arial, Helvetica, non-serif">This is a local stylesheet declaration. </myOwntagName>

    What i mean is that the above css inline code won't work or do anything because "myOwntagName" isnt recognized as an html tag. Is there a way to define your own tags? is this what xml is about (another thing i have to learn.)

    thanksNadvance,
    appreciated

    shokesy
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Nov 2001
    Posts
    1,882
    Rep Power
    19
    XML was designed to describe data, and to focus on what data is.

    HTML was designed to display data, and to focus on how data looks.
    http://www.w3schools.com/xml/xml_display.asp
  4. #3
  5. Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Jun 2002
    Location
    Washington, DC
    Posts
    2,692
    Rep Power
    21
    What i mean is that the above css inline code won't work or do anything because "myOwntagName" isnt recognized as an html tag. Is there a way to define your own tags? is this what xml is about
    Bingo.....

    But you are losing the whole purpose of CSS. Check out this code for example -->

    Code:
    <style type="text/css">
    <!--
    .table {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 12px;
    	color: #000000;
    	background-color: #FFFFFF;
    	border: 1px solid #000000;
    	padding: 10px;
    }-->
    </style>
    
    <!-- The above defined our style -->
    
    <table width="400" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td class="table">A simple table with a style applied</td>
    </tr>
    </table>
    
    <!-- The above is the style applied to our table, eg: td class="table" -->
    Copy and paste that code and run in your browser to see the output. No need to waste the power of xml when you can do it with a style sheet...
    ~ Joe Penn
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Posts
    62
    Rep Power
    12
    thanks guys....

    and that table example, WICKED! now i see the light

IMN logo majestic logo threadwatch logo seochat tools logo