CSS not working in Chrome if I add it in the would do. – Hema Nandagopal Aug 09 '17 at 14:28

  • Try clearing cache or open your webpage in private browsing probably your changes are not pritning – AutoTester213 Aug 09 '17 at 14:29
  • What exactly is “not working”? And why are you only showing us code that has inline styles applied _and_ uses a `style` element in the head? – CBroe Aug 09 '17 at 14:31
  • Inspect the DOM and see whether you actually see that style tag there. Right click and go to Inspect and then find the Elements tab. – taronish4 Aug 09 '17 at 14:34
  • If everything properly set, you need to clear cache data in your web browser. This also happened to me when using chrome – Blasanka Aug 09 '17 at 14:36
  • Your styles for tr inside the css is wrong. What is this: `` and this: `tr {border: solid 1px black; ` your styles in style tag for border will overwrite from inside the tr tag. – Blasanka Aug 09 '17 at 14:37
  • 3 Answers3

    2

    Change your CSS to the following. It has a typo.

    <style>
         th {
         border: 1px solid black; 
         padding-left: 7px; 
         padding-right: 7px;
         }
    </style>
    

    If you want to add border to tr visit this link.

    Lime
    • 13,400
    • 11
    • 56
    • 88
    0

    Change this:

    border: solid 1px black;
    

    to this:

    border: 1px solid black;
    
    Luiz Gonçalves
    • 549
    • 3
    • 11
    0
    <style type="text/css">
         th {
         border: solid 1px black; 
         padding-left: 7px; 
         padding-right: 7px;
         }
     </style>
    

    Actually in your code your are giving border to tr which does not make sense click here to know more.

    So replace tr to th in your above code and it work.

    code pic