Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

eXccel

macrumors newbie
Original poster
May 23, 2011
8
0
Hello,
I am currently learning xhtml & css. I use text wrangler to write the code, and I have a file on my desktop called index.html and use that to preview it. When I open it and preview it in safari, if I write anything using css it will not appear. This goes for safari, firefox, and chrome. Can anyone help?

Thanks
 
Here this is just something basic and it still will not preview. So for example if I took out the
"<style type="text/css">
p {color:blue;}"
it will show up on my web browser.


<html>
<head>
<style type="text/css">
p {color:blue;}
<style>
</head>
<body>
this is normal text

<p>this is paragraph text</p>
</body>
</html>
 
are you trying to use the css code inside the html file? i think it would make things much easier if you moved the css code into its own file such as style.css, so in index.html you'd have this inside the "head" tags:

Code:
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>

and then inside the style.css file you'd have:

Code:
p {
color:blue;
}
 
are you trying to use the css code inside the html file? i think it would make things much easier if you moved the css code into its own file such as style.css, so in index.html you'd have this inside the "head" tags:

Code:
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>

and then inside the style.css file you'd have:

Code:
p {
color:blue;
}

Thank you very much!
 
This:
PHP:
	<style type="text/css">
		p {color:blue;}
	<style>

Should be this:
PHP:
<style type="text/css">
		p {color:blue;}
	</style>


You didn't close the ending style tag
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.