5 replies [Last post]
Robocrotch
Offline
newbie
Last seen: 14 years 8 weeks ago
Joined: 2005-06-24
Posts: 3
Points: 0

I've recently been trying to learn more about CSS. I find it great and all but is there a way to have variables?

For example: Say I have 1,000 pages all with the same <title>, can I make it a variable in my stylesheet so that if ever I decide to change the title I don't have to do it 1,000 times?

Same for like a page header, say I want my name on the top left corner of the page, and I don't know, something else on the right hand corner, can I do that via CSS?

If not, what would be the best way of doing it?

Thank you.

Edit: I also havnt figured out how to add styles to <br>, can that be done?

Robocrotch
Offline
newbie
Last seen: 14 years 8 weeks ago
Joined: 2005-06-24
Posts: 3
Points: 0

&lt;title&gt; and headers?

I'm still just testing thigs out, so I went to validator.w3c.org and "checked" this file...

<!DOCTYPE HTML SYSTEM>
	<head> 
		<link rel="stylesheet" type="text/css" href="styles.css"> 
	</head> 
	<body> 
		<h1>This header is 36 pt</h1> 
		<h2>This header is blue</h2> 
		<p>This paragraph has a left margin of 50 pixels</p> 
		<br><br>
		<a href = "testcss.html"> testcss </a>
	</body> 
</html>

This is the stylesheet for it:

body {background-color: white; font-family:'arial';} 
h1 {font-size: 36pt} 
h2 {color: blue} 
p {margin-left: 50px; font-style:italic; color:green}

a:link {color: blue} 
a:visited {color: purple}  
a:hover {color: red}   
a:active {color: purple}

So it's really simple stuff but I'm getting this error:

Line 4, column 7: end tag for "HEAD" which is not finished

</head>

Most likely, You nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>

Another possibility is that you used an element (e.g. 'ul') which requires a child element (e.g. 'li') that you did not include. Hence the parent element is "not finished", not complete.

:? :?

Thanks again

muzishun
Offline
Enthusiast
Lawrence, KS
Last seen: 12 years 1 week ago
Lawrence, KS
Timezone: GMT-6
Joined: 2005-02-08
Posts: 106
Points: 0

&lt;title&gt; and headers?

You're getting the error because you haven't included a < title > tag in the head of your document. As far as I know, there is no way to set the title in a css document. This has to be done with html in your base doc. Since you don't have a title, you're getting a validation error.

Bill Parrott
Co-Owner and Co-Founder
Eternal Second Designs
http//www.EternalSecond.com/

wolfcry911
wolfcry911's picture
Offline
Guru
MA, USA
Last seen: 5 years 24 weeks ago
MA, USA
Timezone: GMT-5
Joined: 2004-09-01
Posts: 3224
Points: 237

&lt;title&gt; and headers?

You could do it with php includes. But why would you want to? Each title should be unique to it's page.

Robocrotch
Offline
newbie
Last seen: 14 years 8 weeks ago
Joined: 2005-06-24
Posts: 3
Points: 0

&lt;title&gt; and headers?

I guess I have to go study some php as well.

Thank you all, it's just what I was looking for.

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 1 year 3 days ago
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9668
Points: 801

&lt;title&gt; and headers?

<!DOCTYPE HTML SYSTEM>

Don't forget a real doctype Laughing out loud

Verschwindende wrote:
  • CSS doesn't make pies