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

CSS and DHTML errors

Options
  • 05-04-2001 4:41pm
    #1
    Registered Users Posts: 2,660 ✭✭✭


    Right so somebody deleted my posts, thats okay because I'm past them problems anyway, now I've got new ones.

    I have a css file which specifies the format of my links. I also have a font tag in the main body of each page which specifies the name and size that I want a font.

    These two things work fine hand in hand for all pages of my site except one. This page is my navigation page and it has a <DIV> tag a <FORM> tag and a <TABLE> tag all within one another in the order given (div highest). The css file which formats the links works absolutely fine but the font tag is not doing its thing (font too big inside the div).

    I don't know however what is wrong, I know the symptoms but I don't know whats causing it. If you need more to go on please get back to me asap as it's really annoying.

    ta.


Comments

  • Registered Users Posts: 12,309 ✭✭✭✭Bard


    Not a heck of a lot to go on there, tbh Baz_ ... put it online and give us a URL and I can take a first hand look and probably sort you out with a solution...

    Bard
    "Ooh! You're so clever today you'd better be careful your foot doesn't fall off." -Nursie


  • Registered Users Posts: 2,660 ✭✭✭Baz_


    There you go

    Now as you'll see the writing in the nav frame is bigger but I want it the same size as in the other frame.

    The line that was formatting the font is
    <FONT SIZE="-1" FACE="verdana"> but I took it out because it was making no difference.

    It came directly after the body tag, so there you go thats all I has for ya.

    ta for the help.

    [This message has been edited by Baz_ (edited 05-04-2001).]


  • Closed Accounts Posts: 1,651 ✭✭✭Enygma


    You need to put the font tags inside the TD's of the table.
    It's a balls but it does the trick.
    &lt;table border="0"&gt;
    &lt;tr&gt;
     &lt;td&gt;
     &lt;font face="verdana, tahoma, sans-serif" size="1" color="#000066"&gt;
     Text
     &lt;/font&gt;
     &lt;/td&gt;
    &lt;/tr&gt;
    &lt;/table&gt;
    

    ==========EDIT============
    You can put that in your HTML tutorial :P
    Royalty free too biggrin.gif


    [This message has been edited by Enygma (edited 05-04-2001).]


  • Registered Users Posts: 2,660 ✭✭✭Baz_


    ta enygma but is there no other way to do it cos that sucks big time, but I still am very grateful.

    thanks a lot


  • Closed Accounts Posts: 1,651 ✭✭✭Enygma


    AFAIK it's the only cross-browser compatible way of doing it.
    You could probably get away with CSS but you'd still have to wrap the text inside the tables in P or DIV tags.
    Anyways, it's not actually that much of a bother once you get used to it.
    Make a few blank ones and copy and paste.




  • Advertisement
  • Registered Users Posts: 2,660 ✭✭✭Baz_


    Well ta enygma thats grand.

    (copy and paste mode on)


  • Registered Users Posts: 12,309 ✭✭✭✭Bard


    apologies for not replying earlier - but Enygma sorted you out I see... I agree with him.
    <font face="Verdana, Arial" size="2">
    ta enygma but is there no other way to do it cos that sucks big time, but I still am very grateful.
    </font>

    er... what "sucks big time" about putting the font tags inside the table? ... makes perfect sense to have them there, I reckon.

    Bard
    "Ooh! You're so clever today you'd better be careful your foot doesn't fall off." -Nursie


  • Closed Accounts Posts: 1,651 ✭✭✭Enygma


    Bard don't you think it would be better to have the TD inherit the FONT properties from the BODY (it does this with the face but not the size for some reason)? Then if you wanted to change the font in the TD from the inherited default then you could use the FONT tag inside there.

    It seems to me that it's code that shouldn't really be necessary.

    Just my opinion.
    Anyhoo, FONT tags are on the way out.
    Kharns solution is the best future-proof way of doing it.


  • Moderators, Social & Fun Moderators Posts: 28,633 Mod ✭✭✭✭Shiminay


    heh - guess who's spent the last 3 days writting style sheets smile.gif



    All the best,

    Dav
    @B^)
    <font face="Verdana, Arial" size="2">Prepare yourself - The Beefy King stirs from his slumber...</font>

    [honey i] violated [the kids]


  • Registered Users Posts: 12,309 ✭✭✭✭Bard


    <font face="Verdana, Arial" size="2">Originally posted by Enygma:
    Bard don't you think it would be better to have the TD inherit the FONT properties from the BODY (it does this with the face but not the size for some reason)? </font>

    Umm... not really... but why are you asking me?

    The table, as an element in it's own right, doesnt need to inherit any particular font properties from the body outside it. For cross-browser compatibility, fonts should be defined within the specific cells themselves as in, either a CSS class applying a style to the cell itself, or a <FONT></FONT> HTML tag within the <TD></TD> tags.

    Kharn's solution *is* the best (g'wan the Kharn!) - but it's better when coupled with a solution for older, non-CSS-compliant browsers.

    Cheers,

    Bard
    "Ooh! You're so clever today you'd better be careful your foot doesn't fall off." -Nursie


  • Advertisement
  • Registered Users Posts: 2,660 ✭✭✭Baz_


    What versions of each particular browsers aren't css compliant, any lower than 4 and I don't think I'll be bothering with the non css compliant stuff.

    But I really luuurve kharns idea.

    anyways ta for all the help from everybody, greatly appreciated.


  • Moderators, Social & Fun Moderators Posts: 28,633 Mod ✭✭✭✭Shiminay


    You could modify the <TD> tag to specify the font face, size etc with CSS...

    eg:
    TD
    {
        COLOR: #000066;
        FONT-FAMILY: verdana, tahoma, sans-serif;
        FONT-SIZE: 10px;
        LINE-HEIGHT: normal;
        TEXT-ALIGN: left;
        TEXT-DECORATION: none;
        TEXT-INDENT: 0px
    }
    



    All the best,

    Dav
    @B^)
    <font face="Verdana, Arial" size="2">Prepare yourself - The Beefy King stirs from his slumber...</font>

    [honey i] violated [the kids]


  • Registered Users Posts: 2,660 ✭✭✭Baz_


    oooooh, well thats a very nice idea kharn, I'll be doing that when I get home, very nice indeed.


Advertisement