您的位置:首页 > Web前端 > CSS

HTML 样式 & 链接

2015-07-27 16:34 573 查看
HTML样式

外部样式表

<head>

    <link rel="stylesheet" type="text/css" href="~/Content/StyleSheet1.css">

</head>

内部样式表
<head>

    <style type="text/css">

        body {background-color : yellowgreen}

        h1 {color:red}

        p {color:blue}

    </style>
</head>

内联样式
<b style="color:greenyellow"> Bold </b> <br/> <!--粗体-->

没有下划线的链接
<a href="http://www.google.com" style="text-decoration:none">Google</a> <br/>
*Note: <style>定义样式定义 <link>定义资源引用




HTML链接

创建超级链接

<a href="https://www.baidu.com" target="_blank">BaiDu</a> <br/>

<a href="http://www.google.com" style="text-decoration:none">Google</a> <br/>

将图像作为链接
<a href="http://www.hao123.com"> <img border="0" src="~/Content/Media.png"/> </a> <br/>

target属性
<a href="https://www.baidu.com" target="_blank">BaiDu</a> <br/>

name属性
 <a name="tips">锚</a> <br/>
.......
<!--锚-->

<a href="#tips">Jump to 锚</a> <br/>

链接到本地资源
<!--本地资源-->

<a href="~/Content/Site.css">Site.css</a> <br/>

创建电子邮件
<!--邮件-->
<a href="mailto:v-victw@microsoft.com?subject=Hello%20again">Send email to Victor</a> <br/>
<!--邮件及抄送-->
<a href="mailto:v-victw@microsoft.com?cc=v-amal@microsoft.com&bcc=v-gaw@microsoft.com&subject=Summer%20Party&body=You%20are%20invited%20to%20a%20big%20summer%20party">Party</a>

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: