/    Sign up×
Community /Pin to ProfileBookmark

href in external css

Can I include my link info in an external css?

to post a comment
CSS

9 Comments(s)

Copy linkTweet thisAlerts:
@PattonDec 02.2006 — You can use this [code=html]<link href="cssfile.css" rel="stylesheet" type="text/css">[/code]
Or:
[code=html]<style type="text/css">
<!--
@import url("cssfile.css");
-->
</style>[/code]

The above code is good is you want to have styles on the page, and have external ones, or if you want to have more than 1 sheet attached.

Remember, in the CSS file, you do not need to start with "<style type="text/css"> and end with "</style>".

Your CSS file just start with CSS, example, your CSS file could look like this:
[code=html]p { color: #000000; }[/code]
Just doesn't require an starting and ending tag.

THese do go in hte <head></head> part of your site.

Hope thats helpful. ?
Copy linkTweet thisAlerts:
@rdubauthorDec 02.2006 — OK. Instead of using

<link rel="stylesheet" href="nav.css">

I would use

<link href="cssfile.css" rel="stylesheet" type="text/css">

and I could include the link in the css file instead of the html, is that correct?
Copy linkTweet thisAlerts:
@ryanbutlerDec 02.2006 — You include this:

[CODE]<link href="cssfile.css" rel="stylesheet" type="text/css">[/CODE]

inside the HTML file.
Copy linkTweet thisAlerts:
@rdubauthorDec 02.2006 — To clarify, I could include a link, say to www.invisiongrafix.com, within the external css file as part of a navigation bar?
Copy linkTweet thisAlerts:
@_Aerospace_Eng_Dec 02.2006 — No CSS can't have html in it. It is only for styling the html. You'll need to look into server side includes if you want certain links to be on all of the page.
Copy linkTweet thisAlerts:
@rdubauthorDec 02.2006 — Perhaps I could use php and mysql and format the results through an exteral css. What do you thinK?
Copy linkTweet thisAlerts:
@_Aerospace_Eng_Dec 02.2006 — I guess I'm not sure what you are asking. Explain your self better. You want to include a url in your external stylesheet? Or you want to use an external CSS but you only want it to apply to your navigation?
Copy linkTweet thisAlerts:
@rdubauthorDec 02.2006 — What I'm trying to accomplish is only having to make changes to a navigation bar once and have it be reflected on all pages of a website. If I can't include the various links in the external css, perhaps using php and mysql, with formatting of results with external css, might work.

If I have a 40 page site, it would become time consuming to have to make changes to all 40 pages if there is a slight change or an addition in one of the links in the navigation bar.

Hope that clarifies.
×

Success!

Help @rdub 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.18,
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,
)...