|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Link problem in css
hi all,
I have a link problem in css, i have 3 files in the same directory, file1.html, file2.html, style.css file1 and file2 are the same except the <style> part, file1 links to style.css but file2 hard code the style between <head> tag. file1.html: <html> <head> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <b>Test CSS</b> <form> <table> <tr> <td align="right"><b>User Name:</b></td> <td><input type="text" name="LoginName" /><td> </tr> <tr> <td align="right"><b>Password:</b></td> <td><input type="password" name="LoginPW" /><td> </tr> </table> <input type="submit" value="Login" /> <input type="reset" value="Reset" /> </form> </body> </html> file2.html: <html> <head> <style type="text/css"> body { background-color: #333333; color: orange; font-family: Verdana; font-size:18px;} table { color: orange; font-family: Verdana; font-size:14px} form { color: orange; font-family: Verdana; font-size:14px} input { font-family: Verdana; font-size:14px} </style> </head> <body> <b>Test CSS</b> <form> <table> <tr> <td align="right"><b>User Name:</b></td> <td><input type="text" name="LoginName" /><td> </tr> <tr> <td align="right"><b>Password:</b></td> <td><input type="password" name="LoginPW" /><td> </tr> </table> <input type="submit" value="Login" /> <input type="reset" value="Reset" /> </form> </body> </html> style.css: <style type="text/css"> body { background-color: #333333; color: orange; font-family: Verdana; font-size:18px;} table { color: orange; font-family: Verdana; font-size:14px} form { color: orange; font-family: Verdana; font-size:14px} input { font-family: Verdana; font-size:14px} </style> However, the output is different. file2.html (hard code css) shows the result I predict. file1.html (link one) cannot change the background colour to #333333 and the text color of <b>Test CSS</b> is not orange. Can anyone tell me why this happens? Thanks a lot. ypc |
|
#2
|
||||
|
||||
|
Try removing the <style> tags from style.css.
__________________
# Jeremy Explain your problem instead of asking how to do what you decided was the solution. |
|
#3
|
|||
|
|||
|
it works now, thanks a lot
ypc |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > Link problem in css |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|