CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 5th, 2003, 09:58 PM
yupong yupong is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 41 yupong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 6 m 34 sec
Reputation Power: 5
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

Reply With Quote
  #2  
Old August 5th, 2003, 10:10 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,282 jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level)jharnois User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 16 m 26 sec
Reputation Power: 744
Try removing the <style> tags from style.css.
__________________
# Jeremy

Explain your problem instead of asking how to do what you decided was the solution.

Reply With Quote
  #3  
Old August 5th, 2003, 11:30 PM
yupong yupong is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 41 yupong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 6 m 34 sec
Reputation Power: 5
it works now, thanks a lot

ypc

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Link problem in css


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway