Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > CSS
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 02-01-2012, 03:01 PM
  #1
DReality
Novice (Level 1)
 
Join Date: Feb 2012
Posts: 5
iTrader: (0)
DReality is an unknown quantity at this point
External CSS isn't Loading in Browser

Hey, I'm new to the forum and glad to be here. I started learning XHTML and CSS 4 weeks ago. They are my first markup languages and I've found using them to be a little challenging. I'm building my first website and whenever I apply external CSS, my browser quits showing it. My code becomes normal HTML.

If I use internal CSS, my browser shows it. I'm having a similar problem with loading images off of my hard drive rather than the web. Can someone help please
DReality is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 02-01-2012, 03:18 PM
  #2
Pegasus
Mama Hen
 
Pegasus's Avatar
 
Join Date: Nov 2001
Location: 35º South of Santa Claus
Posts: 25,491
iTrader: (0)
Pegasus is a splendid one to beholdPegasus is a splendid one to beholdPegasus is a splendid one to beholdPegasus is a splendid one to beholdPegasus is a splendid one to beholdPegasus is a splendid one to beholdPegasus is a splendid one to behold
We'd need to see the code you're using. Can we get a link to the page(s) that don't work or, failing that, post your code here, inside [html] tags.
Pegasus is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 02-01-2012, 04:44 PM
  #3
Drew
Myrmidon (Level 12)
 
Join Date: Oct 2011
Posts: 160
iTrader: (0)
Drew is on a distinguished road
Check "View" In your browser, make sure styles > page styles is enabled, else wise, make sure your code to import the style sheet is correct, it should look something like

Code:
<link href="directory" rel="stylesheet" type="text/css" media="all" />
Drew is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 02-04-2012, 03:25 AM
  #4
DReality
Novice (Level 1)
 
Join Date: Feb 2012
Posts: 5
iTrader: (0)
DReality is an unknown quantity at this point
I'm using Windows if that matters. And here's the code, its still not showing up.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Basic//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>


<head>
<meta http-equiv="Content-Type" content="text/html"; charset=ISO-8859-1">

<title> Home | Deciphering Reality </title>

<link href="Documents/webcss.css" rel="stylesheet" type="text/css" media="all" />



</head>




<body>

<p>
This is my first website. Check out my background.

</p>




</body>



</html>



Then the css I'm using currently is:

body {
font-family: helvetica, arial, sans-serif;
font-size: 14px;
margin: 0px;
padding: 0px;
background-image:url("http://i1152.photobucket.com/albums/p482/DecipheringReality/Website-Background-1.jpg");
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
}
DReality is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 02-04-2012, 06:41 AM
  #5
Pegasus
Mama Hen
 
Pegasus's Avatar
 
Join Date: Nov 2001
Location: 35º South of Santa Claus
Posts: 25,491
iTrader: (0)
Pegasus is a splendid one to beholdPegasus is a splendid one to beholdPegasus is a splendid one to beholdPegasus is a splendid one to beholdPegasus is a splendid one to beholdPegasus is a splendid one to beholdPegasus is a splendid one to behold
Part of your problem is that your image is 158kb. Try this one.
Attached Thumbnails
Click image for larger version

Name:	Website-Background-1a.jpg
Views:	5
Size:	57.7 KB
ID:	12000  
Pegasus is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 02-04-2012, 07:12 PM
  #6
DReality
Novice (Level 1)
 
Join Date: Feb 2012
Posts: 5
iTrader: (0)
DReality is an unknown quantity at this point
Quote:
Originally Posted by Pegasus View Post
Part of your problem is that your image is 158kb. Try this one.
I didn't realize it was that big, thank you!


And unfortunately I still can't get the image or my other css to load. I'm wondering if it could be my computer... about two weeks ago I could load external css. I'm not sure why it won't anymore but this is a big problem considering the building of my website depends on this. (damn technology lol)
DReality is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 02-04-2012, 08:23 PM
  #7
Pegasus
Mama Hen
 
Pegasus's Avatar
 
Join Date: Nov 2001
Location: 35º South of Santa Claus
Posts: 25,491
iTrader: (0)
Pegasus is a splendid one to beholdPegasus is a splendid one to beholdPegasus is a splendid one to beholdPegasus is a splendid one to beholdPegasus is a splendid one to beholdPegasus is a splendid one to beholdPegasus is a splendid one to behold
Okay, correct me if I'm wrong, but your .css file is in the folder "Documents" on your computer and the background-image is hosted in Photobucket. What happens when you put the image in the same general location as the .css file? Either both on your computer or both hosted elsewhere.

Another option might be to add a width and height value to your CSS for the body tag. Just to see what happens. Sometimes, if a height and width isn't specified, a background-image won't show up because there's not enough space to show the image. Just a thought, anyway.

Last edited by Pegasus : 02-04-2012 at 08:26 PM.
Pegasus is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 02-05-2012, 03:29 AM
  #8
SpAm
Lvl is over 9000!!
 
SpAm's Avatar
 
Join Date: Dec 2009
Location: Norfolk
Posts: 1,294
iTrader: (0)
SpAm is a name known to allSpAm is a name known to allSpAm is a name known to allSpAm is a name known to allSpAm is a name known to allSpAm is a name known to all
Hi DReality

Firstly, have you cleared your cache? The page may be working fine, but if your browser is loading from cache then you may get the wrong version.

Secondly, is the path correct for your CSS file. As peg mentioned, the path you have specified is a relative one, stating that the CSS file is in a folder called 'Documents', but also that this 'Documents' folder is in the same directory as the HTML file.

If it is not, could you tell us where the HTML file is, and where the CSS file is (file paths I mean). Then we can give you accurate relative paths.
__________________
-----Sig-----
//Improvement in coding is iterative, each 'failure' is just the next step on your learning curve, some knowledge and logic can get you a long way.//
SpAm is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 02-05-2012, 06:18 PM
  #9
DReality
Novice (Level 1)
 
Join Date: Feb 2012
Posts: 5
iTrader: (0)
DReality is an unknown quantity at this point
Quote:
Originally Posted by SpAm View Post
Hi DReality

Firstly, have you cleared your cache? The page may be working fine, but if your browser is loading from cache then you may get the wrong version.

Secondly, is the path correct for your CSS file. As peg mentioned, the path you have specified is a relative one, stating that the CSS file is in a folder called 'Documents', but also that this 'Documents' folder is in the same directory as the HTML file.

If it is not, could you tell us where the HTML file is, and where the CSS file is (file paths I mean). Then we can give you accurate relative paths.

You are amazing!! I cleared my cache and now my external css is loading. I had experimented with absolute links using a photobucket account so I could see how the layout was working. Now I'm going to use relative links again, keeping all my files in the documents folder together.

Again, thank you!
DReality is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 02-06-2012, 02:47 AM
  #10
SpAm
Lvl is over 9000!!
 
SpAm's Avatar
 
Join Date: Dec 2009
Location: Norfolk
Posts: 1,294
iTrader: (0)
SpAm is a name known to allSpAm is a name known to allSpAm is a name known to allSpAm is a name known to allSpAm is a name known to allSpAm is a name known to all
Quote:
Originally Posted by DReality View Post
You are amazing!! I cleared my cache and now my external css is loading. I had experimented with absolute links using a photobucket account so I could see how the layout was working. Now I'm going to use relative links again, keeping all my files in the documents folder together.

Again, thank you!
No problem Glad I could could
__________________
-----Sig-----
//Improvement in coding is iterative, each 'failure' is just the next step on your learning curve, some knowledge and logic can get you a long way.//
SpAm is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Reply
KEEP TABS
SPONSORS
 
Boxedart

 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  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
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 07:33 PM.

   

Mascot team created by Drawshop.com | Web Hosting

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.