471,598 Members | 1,306 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,598 software developers and data experts.

If CSS was a living thing i would decapitate it!

Death Slaught
1,137 1GB
Ok im new to CSS and i learned enough to do what i wanted till i tried it on the actual page but what im tryin to use CSS for is to change the color of my links to red and have an image repeated it works on when these are the scripts:


[PHP]body
{
background-image:
url("D:\WebSite\Pictures\grim3.jpg");
background-repeat:
repeat;
background-attachment:
fixed
}
p {color: red}[/PHP]

[HTML]<html>
<head>
<link rel="stylesheet"
type="text/css" href="D:\WebSite\ex1.css" />
</head>
</html>[/HTML]

its on a USB flash drive if that has anything to do with it but im not done with the site yet so im not putting it on my server. and this is the scripts that dont work.

[PHP]body
{
background-image:
url("D:\WebSite\Pictures\grim3.jpg");
background-repeat:
repeat;
background-attachment:
fixed
}
p {color: red}[/PHP]

[HTML]<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<link rel="stylesheet"
type="text/css" href="D:\WebSite\ex1.css" />
<title>Title</title>
</head>
<body>
<font color="red">
<center>
</center>
<ul>
<li><a href="D:\WebSite\HomePage.html">Home</a></li>
<li><a href="D:\WebSite\MusicPage.html">Music</a></li>
<li><a href="D:\WebSite\GamesPage.html">Games</a></li>
<li><a href="D:\WebSite\PicturesPage.html">Pictures</a></li>
<li><a href="D:\WebSite\DownloadsPage.html">Downloads</a></li>
</ul>
<br />
<br />
<center>
Hello welcome to the site I hope you enjoy it!
</center>
</font>
</body>
</html>[/HTML]


all it does is display a white background with red links and text its really annoying any help would be greatly appreciated.


Thanks, Death Slaught
Aug 18 '07 #1
4 1173
drhowarddrfine
7,435 Expert 4TB
It works for me. Are you sure the image is where you say it is? Can you access that location using your browser?

In addition, you don't need to change it now but <font> and <center> do not exist in xhtml but, as we talked about in the other thread, you are serving it as html and it works there.
Aug 18 '07 #2
I hate CSS too but your major problem is that you're using absolute URLs that will only work on your own machine, and only for a brief time. Instead of using D:\BLaBlaBla\Image.jpg you might try simply images/image.jpg (if your images are placed in an images folder in the same place as your HTML file).

You're not going to be able to share that HTML the way you've written it. Also, avoid the backslash character. That has a special meaning. Use the forward slash instead.

Finally, links have their own color apart from the text color, so it's best to apply their own color separately. For example the following will have a nice effect. Note how I set the background to black so that even if you screw up the link to the image (which I assume is a dark and stormy picture), things still look alright:

Expand|Select|Wrap|Line Numbers
  1. body { background:black; url(images/grim3.jpg); }
  2. a { color:red; text-decoration:none; }
  3. a:hover { color:orange; text-decoration:underline; }
  4.  
Aug 19 '07 #3
Death Slaught
1,137 1GB
It works for me. Are you sure the image is where you say it is? Can you access that location using your browser?

In addition, you don't need to change it now but <font> and <center> do not exist in xhtml but, as we talked about in the other thread, you are serving it as html and it works there.
I found the problem my USB flash drive wasnt all the in lol and i know i dont need the center and font i had that was from before i did the CSS part so thanks.
Aug 20 '07 #4
Death Slaught
1,137 1GB
I hate CSS too but your major problem is that you're using absolute URLs that will only work on your own machine, and only for a brief time. Instead of using D:\BLaBlaBla\Image.jpg you might try simply images/image.jpg (if your images are placed in an images folder in the same place as your HTML file).

You're not going to be able to share that HTML the way you've written it. Also, avoid the backslash character. That has a special meaning. Use the forward slash instead.

Finally, links have their own color apart from the text color, so it's best to apply their own color separately. For example the following will have a nice effect. Note how I set the background to black so that even if you screw up the link to the image (which I assume is a dark and stormy picture), things still look alright:

Expand|Select|Wrap|Line Numbers
  1. body { background:black; url(images/grim3.jpg); }
  2. a { color:red; text-decoration:none; }
  3. a:hover { color:orange; text-decoration:underline; }
  4.  
thanks but i fixed it and by the time im done with the site i wont need to have a black background the pictures gona come up and its gona like it lol and no its not a stormy picture it is dark though its an awesome pic of the grim reaper amazing what clients ask for huh? o well thanks anyways!
Aug 20 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Frostillicus | last post: by
15 posts views Thread by Thomas Dybdahl Ahle | last post: by
reply views Thread by majorcolletmkvu | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.