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

    Join Date
    Sep 2003
    Posts
    49
    Rep Power
    11

    CSS: Defining own styles


    I've read up, and have always used a bit of CSS. I'm redoing my site, and noticed something different between Mozilla and IE.

    Personally, I'd ditch IE, but 98% of my viewers use it, so I can't. Basically, in IE, the following works:

    Code:
    P
    {
    	color: black;
    	font-size: 10pt;
    	font-family:tahoma;
    }
    
    myown
    {
    	color: blue;
    	font-size: 10pt;
    	font-family: Tahoma;
    }
    
    <myown>This is my text</myown>
    When I run it in IE though, it basically ignores the self-defined tag, and requires me to use a pre-defined keyword. I don't want to use "P", b/c it carries the html<P> tag characteristics... a new line in this case.

    Thanks.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    6
    Rep Power
    0
    you need to specify whether it is a # or . ...

    ie...
    use this if you are going to use the class more than once on a page
    Code:
    .myown
    {
            color: blue;
            font-size: 10pt;
            font-family: Tahoma;
    }
    for this case you would specify in the HTML
    Code:
    <div class="myown">This is my text</div>

    if you use a # instead of a . then you should only use this element ONCE per page. the HTML would look like this.
    Code:
    <div id="myown">This is my text</div>
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    49
    Rep Power
    11
    You're a rockstar. Thanks. I need to read up on DIV and CLASS I suppose.

    Actually, I tried it like this (just experimenting, not knowing what they would do. They solved one problem, but not another.

    What I'm trying to do is print out a page counter (like in a forum). I've got a Perl script that calculates the number of pages, and then prints them out with links. The problem was, it was stupid to have a link to the page you were on. When I used "P" (assuming you were on page 4 of 7) it looked something like

    1, 2, 3,
    4,
    5, 6, 7,

    Using .myown as you stated above worked, but only when I closed the DIV after ALL of the pages were displayed. I assume breaking a DIV is going to start everything after that on a new line?

    Anyways, thanks!
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    city of sin, state of the art
    Posts
    421
    Rep Power
    0
    yea why not just make the page numbers in their own div/span?

    good lucky and rock on!!
    "I hate quotations."
    -ralph waldo emerson-

IMN logo majestic logo threadwatch logo seochat tools logo