HTML-04.新浪新闻-标题-超链接

1.超链接

标签:<a>

属性:

href:指定资源访问的url

target:指定在何处打开资源链接

_self:默认值

_blank:在空白页面打开

2.CSS属性

text-decoration:规定添加到文本的修饰,none表示定义标准的文本(无任何修饰)。

color:定义文本的颜色

html 复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>焦点访谈:中国底气 新思想夯实大国粮仓_新浪新闻</title>
    <!-- 
        1.超链接
        标签:<a>
        属性:
            href:指定资源访问的url
            target:指定在何处打开资源链接
                _self:默认值
                _blank:在空白页面打开
        2.CSS属性
        text-decoration:规定添加到文本的修饰,none表示定义标准的文本(无任何修饰)。
        color:定义文本的颜色
    -->
    <style> 
        h1 {
            color: #4D4F53;
        }
        .cls {
            color: #8897BA;
            font-size: 16px;
        }
        a {
            color: #141B23;
            text-decoration: none;
        }
    </style>
</head>
<body>
    <img src="./img/news_logo.png" > <a href="https://gov.sina.com.cn/" target="_self">新浪政务</a> >正文
    <h1>  
        焦点访谈:中国底气 新思想夯实大国粮仓
    </h1>
    <hr>
    <span id="time" class="cls">2023年03月02日 21:50</span> <span><a href="https://news.cctv.com/2023/03/02/ARTIUCKFf9kE9eXgYE46ugx3230302.shtml" target="_blank">央视网</a></span>
    <hr>
</body>
</html>
相关推荐
Xin_z_7 小时前
Vue3 + Element Plus el-tree 节点点击选中问题修复总结
前端·javascript·vue.js
专注方法攻略分享7 小时前
网站显示503 Service Unavailable错误怎么办
网络·html
dust_and_stars7 小时前
Ubuntu 24.04 安装配置 vscode-server
前端·ubuntu·eureka
Never_Satisfied7 小时前
在HTML & CSS中,letter-spacing详解
前端·css·html
We་ct7 小时前
LeetCode 106. 从中序与后序遍历序列构造二叉树:题解+思路拆解
前端·数据结构·算法·leetcode·typescript
Never_Satisfied7 小时前
在HTML & CSS中,Animation 属性使用详解
前端·css·html
少云清8 小时前
【UI自动化测试】9_web自动化测试 _元素等待
前端·web自动化测试
Never_Satisfied8 小时前
在JavaScript / HTML中,模板克隆并添加监听的注意事项
前端·javascript·html
明月_清风8 小时前
告别视口依赖:Container Queries 开启响应式组件的“后媒体查询”时代
前端·css
明月_清风8 小时前
从样式表到渲染引擎:2026 年前端必须掌握的 CSS 架构新特性
前端·css