Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS base target ???

Status
Not open for further replies.

BobbaFet

Programmer
Feb 25, 2001
903
NL
Hi all,

In html you can set a default base target so you have a standard way of opening other sites by using this line:

<base target=&quot;_self&quot;>

But is there an something like that in CSS? I'm updating
my site to have all the default make up of it in one CSS
file. So if I could put this in a CSS file too, it would
help me allot.

Thanx allot,

BobbaFet Everyone has a right to my opinion.
E-mail me at cwcon@programmer.net
Be a nice guy 'n press that little ol' button
VVV---(this one) for me ;-)
 
Nope CSS has no power over something like that. ===
Supports Mozilla and Web Standards
Knows HTML/XHTML, CSS1, JavaScript, PHP, C++, DOM1
===
 
Hi BobbaFet,

If you have the opportunity to use Include-files (SSI) you can make a sort of headerdefault-include file.
[for example if you use ASP-server side script, but I read some posts here that you can also make include files by other ways, but I don't have experience with that]:

<head>
<!--#INCLUDE VIRTUAL=&quot;/headerdefaults.htm&quot;-->
</head>

put this in the file 'headerdefaults.htm':

<link rel=&quot;stylesheet&quot; href=&quot;/yourCSSfile.css&quot; type=&quot;text/css&quot;>
<base target=&quot;_self&quot;>

Now you only have to code the target once, and write the <!--#INCLUDE VIRTUAL=&quot;/headerdefaults.htm&quot;--> in the pages where the target is used. If you have pages where you don't use the target you can only write the
<link rel=&quot;stylesheet&quot; ......> in your <head>

If you also use a javasript file you can also put this in the 'headerdefaults.htm':

<script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot; src=&quot;/javascript/yourJSfile.js&quot;></script>

Hope this helps,
Erik

 
Thanks for the tip, Erik

But I think you need to use ASP for that include file,
your talking about right ??? Now my question is if I'm
going to use a include file, like you proposed, can I still
use the html code I have already written ??? (I am not familiar with ASP, maybe I should get a book on it ...)

I mean that I can still use the normal html tags like
<table>, <hr> and stuff like that right ???

greetz,

BobbaFet Everyone has a right to my opinion.
E-mail me at cwcon@programmer.net
Be a nice guy 'n press that little ol' button
VVV---(this one) for me ;-)
 
Yes , you can.

Like I said: the code <link rel=&quot;stylesheet&quot; href=&quot;/yourCSSfile.css&quot; type=&quot;text/css&quot;>
<base target=&quot;_self&quot;>
is in the include file <base> and <linl> are standard HTML tags, so you can also put other html tags in the include file,

Erik
 
None of those methods require ASP. The only one that requires anything special is the INCLUDE one, which requires Server Side Includes (SSI). BUT, most ISPs have this available, so it shouldn't be a problem. You probably will have to rename your .html files to .shtml to make it work though (but only the ones that use INCLUDE). Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top