1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How do I change font size for one <td> cell?

Discussion in 'CSS' started by Jetheat, Jul 5, 2017.

  1. #1
    How do I change font size for one <td> cell?
    I have made a html document.

    At the top, there is a style which says:

    body,td,th {
    font-family: Verdana;
    font-size: 15px;
    color: #4D4D4D;
    line-height:normal;
    }

    Notice that it applied to <td> also.
    SEMrush
    So now, I have one particular <td> in a <table> for which I want to change the font size.
    How do I do this?

    Appreciate the help,

    JH
     
    Jetheat, Jul 5, 2017 IP
    SEMrush
  2. Blank ™

    Blank ™ Well-Known Member

    Messages:
    223
    Likes Received:
    18
    Best Answers:
    6
    Trophy Points:
    110
    #2
    Blank ™, Jul 5, 2017 IP
  3. Jetheat

    Jetheat Well-Known Member

    Messages:
    257
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    140
    #3
    I tried that.

    On the top, I have:


    #intro {
    font-family: Verdana;
    font-size: 7px;
    color: #4D4D4D;
    }

    And within the <td> cell, I created a <div> like this:
    <div id="intro">

    It still didn't change the text size.

    Any ideas?

    JH
     
    Jetheat, Jul 5, 2017 IP
  4. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,625
    Likes Received:
    719
    Best Answers:
    151
    Trophy Points:
    420
    #4
    Yes... put the id="intro" directly on the <td> in question... Although, since you've called it "intro"... I'm thinking that this perhaps is a heading, or something like that, which maybe should be a <th> instead? Since you're not providing any context, actual code, or information about the data you want to display, it's hard to say what the correct approach should be.
     
    PoPSiCLe, Jul 5, 2017 IP
    Jetheat likes this.
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    8,646
    Likes Received:
    1,559
    Best Answers:
    225
    Trophy Points:
    515
    #5
    THIS... and also it's highly suspect that you're giving users with accessibility needs the finger with those stupid malfing px metric size declarations, font declarations with no fallback families... makes one wonder if you're even actually using tables for tabular data or are just slopping out tables for layout.

    Of course given the train wreck of how NOT to build a website that's in your signature, Christmas only knows how bad the code is on your current project.
     
    deathshadow, Jul 7, 2017 IP