I am working on a website and I am currently trying to make it look more proffesional with the help of CSS(I am writing this all myself, not using a generator). Recently I installed something that would make a more professional. The only problem is that whenever I look at it through IE or FF the entire CSS page does not load for me. It is either the background, the buttons, or I recieve an old version of my code.

How can I orginize or optimize my CSS sheet to work more properly on a webpage?

/*The CSS page for the site*/
 

body {
background-image:url('Bios/images/BackGround.png');
}

h2{
color:white;
font-size:15px;
text-align:center;
}

p{
color:white;
text-indent:10px;
}

td{
color:white;
}

td.title{
color:white;
text-align:center;
font-size:80px;"
}

li{
color:white;
}

/* Unlisted list */
ul{
color:white;
}

/* Verticle dash bar */
ul.Dashbar{
list-style-type:none;
margin:0;
padding:0;
}

a:link.DB,a:visited.DB{
display:block;
font-weight:bold;
color:white;
background-color:black;
width:120px;
text-align:center;
padding:4px;
text-decoration:none;
text-transform:uppercase;
}

a:hover.DB,a:active.DB{
background-color:dimgray;
}
/* Verticle dash bar */


/*Links*/
a:link {color:red;}      /* unvisited link */
a:visited {color:blue;}  /* visited link */
a:hover {color:white;text-decoration:underline;}  /* mouse over link */
a:active {color:purple;text-decoration:line-through;}  /* selected link */

So you can't see your css styles show up at all?


Did you link your css file to your html inside your head tag?
<link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />

yes, i linked it in the head tag. For some reason I sometimes do not get the background image, and I never get the verticle dashbar to work in IE. I made sure I called the class "DB" in my links that I wish to show up as specified.

Can you post your html aswell?

Hi,
As stilts says, can you post the html too? Your problem isn't likely to be the organization of the css. The path to the body background image and its name are OK? Can you explain "It is either the background, the buttons, or I recieve an old version of my code." a bit more? What is the vertical dashbar? It's an unordered list but doesn't have any dimensions or anything styled inside it.

my HTML is this:

<!DOCTYPE HTML PUBLIC "//Pure Caos//DTD HTML 4.01 Transitional//EN"> 

<html>

<head>
<meta name="description" content="The home page for sales of web pages online." /> 
<meta name="keywords" content="Pure Caos, sales, web development, quotes, web sites, mangagement" /> 
<title>Caos Studio</title>
<link rel="stylesheet" type="text/css" href="God.css" />
</head>

<body>

<!-- The "main" page for Pure Caos Studios -->

<!-- Body of the site -->
<table border="1" align=center width="900" height="700" bgcolor=#000000>
	<tr>
		<td style="color:white"><img src="Bios/images/Corner.png" alt="Corner"/></td>
		<td class="title" width="75%" >Pure Caos Studios</td>
	</tr>

	<tr height="75%">
		<td valign=top>
			<ul class="Dashbar">
				<li><a class="DB" href="index.html">Home</a></li>
				<hr/>
				<li><a class="DB" href="About_us.html">About us</a></li>
				<hr/>
				<li><a class="DB" href="Downloads.html">Downloads</a></li>
				<hr/>
				<li><a class="DB" href="forum">Forum</a></li>
				<hr/>
				<li><a class="DB" href="Bios.html">Bios</a></li>
				<hr/>
				<li><a class="DB" href="Contact_us.html">Contact us</a></li>
			</ul>
		</td>
		<!-- updates go here -->
		<td style="color:white" width="75%" valign=top align=left>
		
		</td>
	</tr>
</table>

<h2>made in 2011, by Reed Norstrom.</h2>

<p align=center>

<script type="text/javascript"><!--
	google_ad_client = "ca-pub-5994993549816675";
	/* Support Pure Caos */
	google_ad_slot = "5439087144";
	google_ad_width = 728;
	google_ad_height = 90;
	//-->
</script>
<script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

</p>

</body>

<!-- V 1.01 -->
</html>

to explain for tenbears. everytime I attempt to load my website somthing goes from my CSS sheet.

  • The repeated background image does not load and the background is then white
  • the buttons do not use the DB class that I made within the style sheet, they are just the default i have described after the virtcle dashbar
  • I atempt to fix these problems by refreshing my screen thinking they were browser errors and I end up getting one of earlier versions of this website. I can tell because each time I check the source code to determine if that is what happened. (this is more uncommon)

the verticle dashbar is supposed to take the links that I specify by adding the DB class to them. the links should have a clickable area around them of about of about 120 pixels, have the text centered, make the font bold and uppercase with the text white with a black background. then the background turns into a dim gray when your mouse is put overtop of it.

I hope this explains well enough what is going on.

Start with validating your page. Then stop using tables for layout and deprecated attributes.

Regards
Arkinder

thank you arkinder, that is why I am moving everything into CSS. So I will stop using deprecated attributes. after that I will get rid of the simple table layout.

thank you for the valadator link though, it will be very good resource later.

If you look at the validator now, you'll see immediately that 'Pure Caos' shouldn't be in the doctype. If you declare the body background as black in your css, then you'll at least have the colour you want even if your image doesn't load. Your buttons actually work as you want them in Firefox 5. It's best to test on as many modern browsers as possible, starting with Firefox, and using Firebug to help you.
Hope that helps a bit.

ok, thank you. those resources may be very good with helping me out to figure out how to fix these errors (I most likely made myself).

Thanks everyone

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.