当前位置: 首页 > news >正文

黑马程序员前端web入门:新浪新闻

黑马程序员前端web入门:新浪新闻
几点学习到的:

  1. 设置li无圆点: list-style: none;
  2. 设置a无下划线:text-decoration: none;
  3. a属于行内元素,高度hegiht不起作用,可以设置 display: block; 把它变成块元素。此时,设置水平居中 text-align: center; , 设置垂直居中 line-height: 30px; 。
  4. 网页布局什么时候用图片背景,什么时候用img标签https://blog.csdn.net/smlljet/article/details/103321869
  5. 如果采用background显示图片,需要设置 padding-left 防止内容与背景重叠。

在这里插入图片描述

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><style>*{margin:0;padding:0;box-sizing: border-box;}li{list-style: none;}a{text-decoration: none;}.news{width: 360px;height: 200px;margin: 100px auto;}.news .hd{height: 34px;background-color: #eee;border: 1px solid #dbdee1;border-left: none;}.news .hd a{height: 34px; width: 48px;display: block;margin-top: -1px;text-align: center;line-height: 30px;border-top:3px solid #ff8400 ;border-right: 1px solid #dbdee1;background-color: #fff;font-size: 14px;color:#333;}.news .bd{padding: 5px;}.news .bd li{padding-left: 15px;background: url('./img/quare.png');background-repeat: no-repeat;background-position: 0 center;background-size: 5px;}.news .bd li a{padding-left: 20px;background: url('./img/picture.png');background-repeat: no-repeat;background-position: 0 center;background-size: 15px;font-size: 12px;color: #666;line-height: 24px;}.news .bd li a:hover{color: #ff8400;}</style>
</head>
<body><div class="news"><div class="hd"><a href="#">新闻</a></div><div class="bd"><ul><li><a href="#">新闻1新闻1新闻1新闻1新闻1新闻1</a></li><li><a href="#">新闻2新闻2新闻2新闻2新闻2新闻2</a></li><li><a href="#">新闻3新闻3新闻3新闻3新闻3新闻3</a></li><li><a href="#">新闻4新闻4新闻4新闻4新闻4新闻4</a></li><li><a href="#">新闻5新闻5新闻5新闻5新闻5新闻5</a></li><li><a href="#">新闻6新闻6新闻6新闻6新闻6新闻6</a></li></ul></div></div>
</body>
</html>
http://www.lryc.cn/news/291841.html

相关文章:

  • 力扣_字符串2—最长有效括号
  • 小程序接入企业微信「联系我」功能
  • jdk17新特性—— 密封类(Sealed Classes)
  • 【亿级数据专题】「分布式消息引擎」 盘点本年度我们探索服务的HA高可用解决方案
  • 计算机网络-物理层设备(中继器 集线器)
  • PaddleDetection学习4——使用Paddle-Lite和OpencCV在 Android 上实现实时的人脸检测(java)
  • mkcert的安装和使用,5分学会在本地开启localhost的https访问方式
  • RHCE DNS域名解析服务器
  • 创建表与删除表(六)
  • 微信开发者工具 git 拉取 failed invalid authentication scheme
  • (4)Elastix图像配准:3D图像
  • windows安装oracle之后怎么连接使用
  • 在前端开发中,常见的数组循环方式有以下几种:
  • Redis -- 单线程模型
  • C语言第十五弹---操作符(上)
  • 使用宝塔面板访问MySQL数据库
  • Win10 双网卡实现同时上内外网
  • Django模型(六)
  • 【Linux】Linux基本指令
  • stm32中的SPI
  • ChatGPT可与自定义GPTs一起使用,智能AI代理时代来啦!
  • 《Numpy 简易速速上手小册》第1章:Numpy 基础(2024 最新版)
  • 【美团】SaaS技术部-后端研发工程师(海外业务)
  • linux安装mongodb数据库启动报错? 都是冰红茶滴水儿
  • win11安装wsl作为linux子系统并当作服务器
  • 户用光伏电站的管理包括哪些内容?需要怎么做?
  • Kafka-服务端-PartitionLeaderSelector、ReplicaStateMachine
  • 总结11(数组)
  • 扩展学习|大数据分析整合到价值创造的大见解
  • 蓝桥杯---牌型种数