2016-02-29 64 views
-2

HTML是像这样:我的HTML和CSS文件将无法链接的请求

<html> 
<head> 
<title>In Loving Memory of Jill Erin Hayes</title> 
<link rel="stylesheet" type="text/css" href="/additional_pages/fp_frye.css" /> 
</head> 

<body> 
<div id="maincontent"> 
<div id="left"> 
<h1>Jill E. Hayes</h1> 
<ul><li>mother</li> 
<li><a href="https://www.utm.edu/departments/finearts/vanguard/index.php">actress</a></li> 
<li>election commissioner</li> 
<li>and so very much more</li> 
</div> 

<div id="right"> 
<h2>Her Story</h2> 
<p>Born to Jerry and Debbie Hayes in Henry, TN in 1980, Jill was always very creative and fun. 
She flew through school, active in 4-H and theatre, all while maintaining good grades and a 
positive outlook on life. She attended the University of Tennessee at Martin after graduating Henry 
County High School, and in college, she majored in theatre and was a very active member of UTM's 
Vanguard theatre program. She met Joseph Frye in college, and the married and had two children, 
Shelby, named after her favorite play, <i>Steel Magnolias</i>, and Hayes, named for her maiden name.</p> 

<p>Jill gave up her dreams of Broadway to be a mother, and she got a job as the Henry County 
Administrator of Elections, where she not only helped her police officer husband raise their family, but 
also was able to be active in the democratic system, which she had always been passionate about. She worked 
elections for fifteen years before illness struck, and she was forced to resign to focus on regaining her 
health.</p> 

<p>Lupus is, unfortunately, into a disease that garners much attention, despite being a fatal one. Jill went 
to countless doctors attempting to find out what was wrong with her before she was finally diagnosed with lupus, 
an aggressive autoimmune disease. This on top of being forced to quit her job as well as the divorce that 
ended a regrettably failing marriage was hard on her, but she still persevered to be the mother that 
both of her children needed. She managed to live with lupus for six years, before passing away at her parents' 
home on October 18, 2015, just weeks before her 25th birthday.</p> 
</div> 
</div> 
</body> 
</html> 

然后我的CSS文件是这样的:

body { 
    background-color:light-green; 
} 

#maincontent { 
    background-color:white; 
    width:680px; 
    height:400px; 
    padding-top:20px; 
    padding-left:20px; 
    padding-right:20px; 
} 

#left { 
    background-color:light-pink; 
    width:200px; 
    float:left; 
    height:200px; 
} 

#right { 
    background-color:light-green; 
    width:400px; 
    float:left; 
    margin-left:40px; 
    height:200px; 
} 

我不明白为什么它赢得” t链接,并且我访问了关于此主题的其他几个论坛主题。我对编码非常陌生 - 这是一个需要毕业的班级 - 我需要帮助。

+0

什么是您的文件结构? –

+0

是否检查过浏览器的调试控制台?也许你的'href'是错误的。 –

+0

谢谢你们!我能够解决这个问题,但是现在我无法看到一张图片......看起来,我真的不想看到编码。 –

回答

1

根据你贴什么的,你的CSS文件应该是一个名为additional_pages目录内,并应具有fp_frye.css

检查的名称,如果你的CSS文件是在正确的地方!

UPD:

改变这一行:

<link rel="stylesheet" type="text/css" href="/additional_pages/fp_frye.css" /> 

到:

<link rel="stylesheet" type="text/css" href="additional_pages/fp_frye.css" /> 

注意, “/” 中的第一个代码,试图访问C:/ additional_pages/fp_fryes.css,当真正的路径不是那个!

+0

@Shelby,检查这是否解决了你的问题! –