<script> tags changes and locks font size - html, css, javascript -
when put script in html file, font changes default , no styling can applied:
<!doctype html> <html> <head> <meta charset="utf-8"> <link rel="stylesheet" href="test.css" type="text/css" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <ul class="topnav"> <li><a href="#home">home</a></li> <li><a href="#news">news</a></li> <li><a href="#contact">contact</a></li> <li><a href="#about">about</a></li> </ul> <script> function myfunction() { } </script> </body> </html>
css file looks this:
ul.topnav li { font-size: 20; }
if take out script font size changes 20.
why happen?
you don't set 'px'.
change to:
ul.topnav li { font-size: 20px; }
Comments
Post a Comment