...

View Full Version : Need some css help for the anchor tag



D34th Maker
01-29-2012, 09:30 PM
hello CF right now i can not figure out why my css is not working also this is my first error ever with css.

Anyways ive hardly done work on the site before i uploaded to the web so im using the sites own editor which i do not think is the problem though it may be.

Anyways again here my current coding for what im working on.

CSS:


body {background-image: url(/images/Backgorund.jpg);
color: white;
}

.Back {Position: absolute;
top: 75%;
left: 50%;
a:link: { color: rgb (255, 255, 255); }
a:visited: { color: rgb (138, 138, 138); }
a:hover: { color: rgb (198, 198, 198); }
a:active: { color: rgb (68, 68, 68);}
} I have also tried putting the css part for the colors in the body part and that did not work, im thinking it may be because it needs to be in a form like this:
a {all the css code for the a here}

and here is the html for what im doing it on:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<link rel="stylesheet" type="text/css" href="CSS.css" />
<title>Calculator 1 - D34th.com
</title>
</head>
<body>
To download our program Click on download Below<br/><br/><br/><p><a href="/Programs/Calculator1.exe">Download</a></p>
<p class="Back"><a href="index.html">Go Back</a></p>
</body>
</html>

also for any one who wants the site for it here d34th.host-ed.me tip: if you do not like godsmack then mute as i have the site auto play voodoo by them when its visited only on the homepage though.

Also another thing is i would only like to change the go back part of it which is why i originally had the css in the .Back part since that is my go back class

Also i have tried using colors but not even that was working.

Excavator
01-29-2012, 10:04 PM
Hello D34th Maker,
Looking at your http://d34th.host-ed.me/d34th_auto_clicker.html , there is a few things you could improve on.
Look at the links in my signature about DocTypes. You need one.
There are also links about validation in my signature, they will help you.
Instead of using the break tag to create space (<br> is for making a linebreak in text), use a little margin on that anchor.
Why wrap your anchors in paragraph tags? They are not paragraphs.

I'm kind of unclear what your specifically wanting to fix. The Go Back link is there, it's just off the page. Try this instead? -
.Back {Position: Absolute;
top: 90%;
left: 48%;
}

Excavator
01-29-2012, 10:16 PM
Just as an example -
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>D34th.com - D34ths Auto Clicker</title>
<style type="text/css">
html, body {
margin: 0;
background: #fc6;
}
#container {
width: 760px;
margin: 30px auto;
padding: 20px;
background: #999;
}
p a {
display: block;
margin: 25px 0 0 25px;
}
#back:link,
#back:visited {
position: absolute;
top: 90%;
left: 48%;
color: #333;
}
#back:hover,
#back:active {color: #f00;}
</style>
</head>
<body>
<div id="container">
<p>
To download our program Click on download Below<br />
<a href="/Programs/D34ths Auto Clicker.exe">Download</a>
</p>
<a href="index.html" id="back">Go Back</a>
<!--end container--></div>
</body>
</html>

D34th Maker
01-29-2012, 10:51 PM
Hello D34th Maker,
Looking at your http://d34th.host-ed.me/d34th_auto_clicker.html , there is a few things you could improve on.
Look at the links in my signature about DocTypes. You need one.
There are also links about validation in my signature, they will help you.
Instead of using the break tag to create space (<br> is for making a linebreak in text), use a little margin on that anchor.
Why wrap your anchors in paragraph tags? They are not paragraphs.

I'm kind of unclear what your specifically wanting to fix. The Go Back link is there, it's just off the page. Try this instead? -
.Back {Position: Absolute;
top: 90%;
left: 48%;
}it is on there as its more in the middle which is why i wanted to change the link colors since it blends into the skull. though i tried making the skull 100% by 100% so it would fill it to the exact match of any ones CPU but i could not figure the css for it and failed at each attempt cause your only seeing about 80-95 % of the bg on my pc since i do not have a way to make it to where it will adjust automatically.
but anyways yeah i might try to get rid of the <p> that are using the anchors and see if that works, i also changed the doc type part of it so maybe it will work for me as im hoping it will, but basically all im asking was why my css colors are not working though it might just be me using paragraohs where i should not.

Quick edit to show where im talking about:
http://d34th.host-ed.me/images/Go_Back.PNG

Excavator
01-29-2012, 11:04 PM
basically all im asking was why my css colors are not working though it might just be me using paragraohs where i should not.

Invalid:
a:link: { color: rgb (255, 255, 255); }
a:visited: { color: rgb (138, 138, 138); }
a:hover: { color: rgb (198, 198, 198); }
a:active: { color: rgb (68, 68, 68);}
}

Valid:

a:link { color: rgb(255,255,255); }
a:visited { color: rgb(138,138,138); }
a:hover { color: rgb(198,198,198); }
a:active { color: rgb(68,68,68);}

Left those spaces in to show those don't matter. The other spaces did matter, I would write it like this -


a:link {color: rgb(255,255,255);}
a:visited {color: rgb(138,138,138);}
a:hover {color: rgb(198,198,198);}
a:active {color: rgb(68,68,68);}

D34th Maker
01-29-2012, 11:56 PM
yeah i viewed your example one and they work perfect so ill change it a little in a bit after all ice hardly done any coding.

Excavator
01-30-2012, 12:20 AM
yeah i viewed your example one and they work perfect so ill change it a little in a bit after all ice hardly done any coding.

Like I said, "There are also links about validation in my signature, they will help you."

D34th Maker
01-30-2012, 01:44 AM
Like I said, "There are also links about validation in my signature, they will help you."
yeah i have two bookmarks for css and html though sometimes the html ones gives me stuff that i cannot really change without it more in likely f-ing my site up but thanks for your time



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum