/    Sign up×
Community /Pin to ProfileBookmark

Meta Tags with CSS

hi.

i was wondering whether it’s possible to add meta tags on an external css file so that each html page calls it.

thx in advance

to post a comment
CSS

7 Comments(s)

Copy linkTweet thisAlerts:
@scragarDec 13.2004 — I don't think it's possible with CSS, that's different from the HTML that reads them(and a search engine wouldn't be able to find them = gross ERROR)

you could use javascript to include them, but then you'd ignore 10% of visitors...
Copy linkTweet thisAlerts:
@cogumeloauthorDec 13.2004 — If i were to use an external .js file with the meta tags, how would search engines handle it?

if i put a "noindex nofollow" tag on a .js how will a search engine deal with it? will it understand that it should ignore the html file that calls that .js ?

thx
Copy linkTweet thisAlerts:
@CharlesDec 13.2004 — I'm not certain that I understand what you are up to, but if I do then you will find the information at http://www.w3.org/TR/html401/present/styles.html#h-14.6 useful.
Copy linkTweet thisAlerts:
@DaiWelshDec 13.2004 — I assume you are just trying to find a way to avoid repeating meta tags in every page when editing? If so CSS is not the right thing to be looking at. Apart from the fact that it is not possible it would be a gross misuse of CSS since CSS should only contain presentation information not content and meta tags are content, albeit a special kind of content.

I would also not recommend javascript, I think you need to look at either a server-side include method (SSI or any server-side scripting language like PHP,ASP etc. can do this) or if you dont have them available and it is just to cut down on maintenance then explore editing tools that can solve this for you (e.g. dreamweaver has templates and libraries for including common code into multiple pages).

HTH,

Dai
Copy linkTweet thisAlerts:
@cogumeloauthorDec 13.2004 — i do use libraries for it ?

i was just curious to know if it could (or should) be done with css.

thx
Copy linkTweet thisAlerts:
@pawkyDec 13.2004 — [i]Originally posted by cogumelo [/i]

[B]i do use libraries for it ?



i was just curious to know if it could (or should) be done with css.



thx [/B]
[/QUOTE]



it cant be done with css. CSS is strictly for styling.

JS cannot be used for this as mentioned above either and it has nothing to do with ignoring 10% of the ppl. People could care less if you have meta tags on your site. What matters is the search engines and they wouldn't be able to read it so you might as well not have it then.

Only option would be either a server-side language or SSI (server side includes). I haven't used either yet ? but many in this forum could help you out there ? tc
Copy linkTweet thisAlerts:
@cogumeloauthorDec 13.2004 — What matters is the search engines and they wouldn't be able to read it so you might as well not have it then.[/QUOTE]

that's what i was trying to figure, search engines would not be able to get the metas if they were placed in a js file.

thx
×

Success!

Help @cogumelo spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...