Add CSS class into HTML

2015-05-17 1:53 am
Is it possible to insert CSS file into HTML separately? like create a new CSS file and then insert the whole file into my current HTML.

In my case I used "a" tag in the nav bar and I want to make a linkable image on the website, so I need to use "a href" to link pages, however the "a" tag were linked, but in the same form as the bar, which is a box (I used box shaped for the nav, instead of just hyperlink).

like this:
a:link, a:visited {
display: block;
width: 230px;
font-weight: bold;
font-size:16px;
color: #FFFFFF;
background-color: #60C;
text-align: center;
padding: 4px;
text-decoration: none;
text-transform: capitalize;
}

a:hover, a:active {
background-color: #FF6;
color:#000
}

回答 (1)

2015-05-17 2:18 am
✔ 最佳答案
css in html have 3 type: external, inpage and inline

For external css, you need to include

<link rel="stylesheet" type="text/css" href="ext-style.css">

in the <head> segment,where ext-style.css is the name of the file
參考: own knowledge


收錄日期: 2021-04-16 16:41:28
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20150516000051KK00046

檢視 Wayback Machine 備份