我有一个包含html元素的jsp文件,它有一个带有特定id的表。 当我添加边框时:1px; 内部样式然后它工作,但当我想使用指定样式的css文件,然后它没有,因此根本没有边框。
jsp文件的相关部分:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Airline Database</title> <link rel="stylesheet" type="text/css" href="styles/PassengerStyle.css"/> </head> <body> <table id="main" width="1300px"> ... </table> </body> </html>PassengerStyle.css文件:
#main { border: 1px solid black; }css文件位于与jsp文件位于同一文件夹中的styles文件夹中。
我错过了什么?
I have a jsp file that holds html elements, it has a table in it with a specific id. When I add the border: 1px; styling internally then it works, but when I want to use a css file that specifies styling, then it doesn't, there's no border at all as a result.
the relevant part of the jsp file:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Airline Database</title> <link rel="stylesheet" type="text/css" href="styles/PassengerStyle.css"/> </head> <body> <table id="main" width="1300px"> ... </table> </body> </html>the PassengerStyle.css file:
#main { border: 1px solid black; }the css file is in the styles folder that is in the same folder as the jsp file.
What did I miss?
最满意答案
它可能找不到样式表,即url是错误的。 您是否尝试导航到“查看源”中的代码认为该文件所在的位置? 那可能与现在不同。
您也可以尝试添加body {background-color:red; 查看该样式表中的任何样式是否适用。
It probably can't find the stylesheet, i.e. the url is wrong. Have you tried navigating to where the code in 'view source' thinks the file is located? That's probably different then where it is.
You can also try adding body { background-color: red; } to see if any styles from that stylesheet apply.
更多推荐
css,jsp,file,文件,px,电脑培训,计算机培训,IT培训"/> <meta name="descriptio
发布评论