CSS简单网页示例

article/2025/11/11 12:32:10

简单今日头条页面实现:

<!DOCTYPE html>
<html><head><meta charset="utf-8"><title>今日头条</title><style>/* 设置body */body{/* 取消doby的内边距 */margin: 0;}/* 设置最底层标签d1 */.d1{/* 设置底层标签的大小 */width: 1200px;height: 805px;/* 设置底层标签的位置 */margin: 0 auto;padding: 0;top: 0;/* 设置底层标签的颜色 */background-color:  #FFFFFF; }.box1,.box2,.box3{/* 设置背景颜色 */background-color:  #FFFFFF;padding-bottom: 5px;}/* 设置图片的样式 */.img_box{margin: 0;padding: 0;float: left;}.box1{/* 设置第一个标签的大小 */width: 100%;height: 85px;}.d2{float: right;padding: ;}/* 设置按钮的样式 */.d1 button{/* 设置登录按钮的大小 */width: 64px;height: 38px;/* 设置按钮及字体颜色 */background-color: #ff4c4c;color: #ffffff;/* 设置外边距 */margin-left: 68px;margin-right: 68px;margin-top: 25px;   border-radius: 5px;border-color: #FFFFFF;}.box2 ul{/* 清除原有图标 */list-style-type: none;/* 设置大小 */width: 190px;height: 396px;padding: 0;float: left;}.box2 li{/* 设置大小 */width: 100%;height: 40px;/* 设置位置 */line-height: 40px;text-align: center;color: #333333;border-radius:5%;}.middle1 li:hover{background-color: #ed4040;color: #FFFFFF;}.box2 .firstli{background-color: #ed4040;color: #FFFFFF;}.middle2{/* 设置大小 */width: 700px;height: 396px;background-color:  #FFFFFF; float: left;margin-top: 20px;}
​.title{/* 设置大小 */width: 72px;height: 48px;font-size: 18px;background-color: #FFFFFF;color: #333333;margin-bottom: 0;/* 设置边框 */border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #ff4c4c;}/* 设置标题底部边框 */.middle2 h2{/* 设置边框 */border-bottom-width: 1px;border-bottom-style: solid;border-bottom-color: #E8E7E3;}/* 设置链接标题 */.box2 .middle2 .link_title{font-size: 20px;color: #000000;text-decoration: none;}/* 设置链接标题的移入效果 */.box2 .middle2 .link_title:hover{color: red;text-decoration: underline;}/* 设置涉及到时间的文字 */.box2 .time{color: #999999;font-size: 13px;}.box2 .middle2 .link_but{width: 30px;height: 23px;line-height: 13px;background-color: red;color: #FFFFFF;font-size: 13px;    }.box2 .middle2 .main_conten{background-color: #FFFFFF;width: 240px;float: left;}.box2 .middle2 img{width: 240px;height: 160px;float: left;}.box2 .middle3{width: 300px;height: 582px;background-color: #FFFFFF;float: left;margin-top: 20px;}.box2 .middle3 .link_puc_right{width: 120px;height: 80px;float: left;}.box2 .middle3 .main_conten{line-height: 50px;}.box2 .middle3 img{width: 50px;height: 50px;position: relative;top: -100px;left: 150px;}.box2 .middle3 .link_title{color: #333333;text-decoration: none;}.bottom_text{width: 400px;font-size: 12px;color: #333333;margin-left: auto;margin-right: auto;text-decoration: none;}.bottom_link{text-decoration: none;color: #333333;}</style></head><body><!-- 最底层标签,用于布局整个界面的位置等 --><div class="d1"><!-- 第一行,用来填入顶部的图片 --><div class="box1"><img src="../img/logo.png" class="img_box"/><img src="../img/advert.jpg" class="img_box"/><div class="d2"><a href="#"><button type="submit">登录</button></a></div></div><!-- 中间部分,用来设置网页主体 --><div class="box2"><!-- 中间部分的左边区域 --><div class="middle1"><ul><li class="firstli">最新发布</li><li>新闻快报</li><li>国内新闻</li><li>国际新闻</li><li>人文风景</li><li>科技创新</li><li>创业俱乐部</li><li>区块链</li><li>互联网</li></ul></div><!-- 中间部分的右边区域 --><div class="middle2"><h2><span class="title">最新发布</span></h2><div class="main_conten"><a href="#" class="link_title">文章标题</a><div class="text"><div class="time">发布于2022-4-23</div><div class="conten">文章摘要...</div><a href="" class="link_but">互联网</a><span>阅读(1024)</span></div><a href="" class="link_puc"><img src="../img/c7y2lxc4ww6kelwdfz.jpg"</a></div><div><a href="#" class="link_title">[腾讯云]12.22云上特惠,云产品限时抢购</a><div class=""><div class="time">发布于2022-3-06</div><div class="conten">腾讯云11.11云上盛惠,精选热门产品助理上云,云服务器首年88元起,买的越多,返的越多,最高返5000元!</div><a href="" class="link_but">互联网</a><span>阅读(564)</span></div><a href=""><img src="../img/cb0wihpicadc7i4hf6.jpg"</a></div></div><!-- 中间部分的右边区域 --><div class="middle3"><h2><span class="title">置顶文章</span></h2><div class="main_conten"><a href="#" class="link_title">文章标题</a><div class="time">2022-4-04</div><img src="../img/c7y2lxc4ww6kelwdfz.jpg" class="link_puc_right"/><a href="" class="link_title">[腾讯云]12.11云上盛惠,云产品限...</a><div class="time">2022-4-15</div></div><img src="../img/cb0wihpicadc7i4hf6.jpg" class="link_puc_right"/></div></div><!-- 底部,用来设置友情链接 --><div class="box3"><h3>友情链接</h3><a href="" class="bottom_link">百度&nbsp;</a><a href="" class="bottom_link">新浪&nbsp;</a><a href="" class="bottom_link">腾讯&nbsp;</a><a href="" class="bottom_link">淘宝</a></div><!-- 最底部,用来放置转义符号等信息 --><div class="bottom_text"><div>&copy;2021 今日头条 京公网安备 11000000000号</div><div>联系电话: 400-156-138</div><span>公司名称: 北京字节跳动科技有限公司 </span><span><a href="" class="bottom_link">管理员登录</a> </span></div></div></body>
</html>
  • 运行结果如下:

     


http://chatgpt.dhexx.cn/article/2M4ko2X8.shtml

相关文章

css背景 ( 6种实例)

css背景实例 图片网站背景1.设置页面的背景颜色2.设置图像作为页面背景2.1图片加入至背景的方式2.1.1通过链接 2.2背景样式 3.定位背景图像4.固定背景5. 多图片背景6.渐变背景 CSS背景属性 图片网站 阿里巴巴矢量图标库 pixabay 图片转链接网站 背景 1.设置页面的背景颜色 …

CSS---‘样式’基础用法 与 案例

1、外部样式表 方式1&#xff1a; <link rel"stylesheet" type"text/css" href"文件路径"></link>方式2&#xff1a;&#xff08;常用&#xff09; <style>import url(文件地址) </style> 2、伪类选择器 a:hover{属性…

HTML+CSS案例

综合案例 1、分析1.1 整体结构1.2 部分结构 2、代码部分2.1 初始化_CSS2.2 头部2.2.1 头部_HTML2.2.2 头部_CSS 2.3、中间轮播图2.3.1 中间轮播图_HTML2.3.2 中间轮播图_CSS 2.4 精品推荐2.4.1 精品推荐_HTML2.4.2 精品推荐_CSS 2.5 底部样式2.5.1 底部样式_HTML2.5.2 底部样式…

css 的常用案例

Css 的几个常用案例 1. css 编写三角形 <!-- 三角形 --><div classtriangle-page><div class"triangle-top"></div><div class"triangle-right"></div><div class"triangle-bottom"></div>&l…

HTML CSS JavaScript简单案例实现

文章目录 简易计算器个人简历登录页面注册页面注册&#xff08;一&#xff09;注册&#xff08;二&#xff09; html、css 实现一个漂亮的表格书城列表页面简单框架全选反选功能 简易计算器 calculator.html <!doctype html> <html> <head><meta charse…

CSS基础学习案例

CSS–小米商城案例 小米商城案例目录 CSS--小米商城案例1.内容回顾2.案例顶部菜单3.二级菜单3.1 划分区域3.2搭建骨架 4.整合 顶部菜单 二级菜单小结5. 推荐菜单5.1整合案例如下5.2 小结 6.CSS进阶知识点6.1 hover&#xff08;伪类&#xff09;6.2 after&#xff08;伪类&…

html/css 个人网站实例(一)

显示效果 HTML代码 <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><title>alalasheep的个人网站</titl…

CSS实例 简单案例

CSS文件 注意改变图片的样式时&#xff0c;是要加给图片所在的标签 比如p /* 整体 */ body {font: 16px/28px "Microsoft YaHei"; }/* 大标题 */ h1 {font-weight: 600;text-align: center; }/* 连接a */ a {text-decoration: none; }/* 时间 来源 */ .scor {font-…

CSS案例(1)

写在前面&#xff1a;本篇所有 css 均使用内嵌式引入。若想使用外链式&#xff0c;需先新建 .css 文件&#xff0c;再通过 link 标签引入到 html 里&#xff0c;样式部分的代码基本不用做其他修改。 目录 1 导航栏样式 2 商品展示页面 3 简单新闻页面 4 布局样式 1 导航栏样…

小案例CSS

代码&#xff1a; <!DOCTYPE html> <html lang"en"> <head> <meta charset"UTF-8"> <meta http-equiv"X-UA-Compatible" content"IEedge"> <meta name"viewport" content"widthde…

CSS常见样式的介绍和使用(附加案例)

CSS样式 一、css介绍 层叠样式表(英文全称&#xff1a;Cascading Style Sheets) ​ 是一种用来表现HTML标准通用标记语言的一个应用&#xff09;或XML&#xff08;标准通用标记语言的一个子集&#xff09;等文件样式的计算机语言。CSS不仅可以静态地修饰网页&#xff0c;还可以…

CSS 示例

基础内容 引入样式表&#xff1a;<link rel"stylesheet" href"test.css"> em&#xff1a;相对大小单位 选择器 示例说明#id选择所有类.clsss选择所有类p选择所有p标签&#xff0c;可以加逗号分组p em后代选择器&#xff0c;选中p标签中所有em标签…

CSS-200个小案例(一)

最近我在youtube上跟着大神学习200个CSS小案例&#xff0c;作者Online Tutorials 编码的内容很实用&#xff0c;案例中涉及定位、变换、动画等概念&#xff0c;适合进一步学习和巩固CSS知识&#xff0c;能帮助我们实现页面的特效。 youtube视频链接&#xff1a;https://www.you…

30个超棒的CSS应用实例

这 篇文章是很早之前在博客园看到的&#xff0c;收藏在网摘里&#xff0c;今天再看发现实在很棒&#xff0c;转载过来方便以后参考用&#xff0c;最棒的地方是这些效果的实现都只是利用CSSHTML 来实现的&#xff0c;基本上没有用到什么FLASH或JS脚本&#xff0c;大家也可以看看…

【CSS实例】

学习目标&#xff1a; css样式学习、总结&#xff0c;知识巩固 学习内容&#xff1a; 在这里我将会发布一些自己学习过程中完成的css实例&#xff0c;可能是跟着网上学习的练习作品&#xff0c;也可能是自己的随意的一个想法。每个作品中会列出编写思路&#xff0c;和编写过程…

codewar代码练习1——8级晋升7级

最近发现一个不错的代码练习网站codewar&#xff08;http://www.codewars.com&#xff09;。注册了一个账号&#xff0c;花了几天的茶余饭后时间做题&#xff0c;把等级从8级升到了7级。本文的目的主要介绍使用感受及相应题目&#xff0c;可供大家参考。 新人注册为8级&#xf…

codewar python 遗忘点

2019独角兽企业重金招聘Python工程师标准>>> 1、计算字符串中特定字符串出现的次数 s this is a new technology,and I want to learn this. print(s.count(this, 0, len(s))) #目标字符串区分大小写 2、数字左边补0的方法,字符串补空格 #python中有一个zfil…

Codewar - Bit Counting

2019独角兽企业重金招聘Python工程师标准>>> Write a function that takes an (unsigned) integer as input, and returns the number of bits that are equal to one in the binary representation of that number. Example: The binary representation of 1234 is…

codewar 代码练习1——8级晋升7级

最近发现一个不错的代码练习网站codewar&#xff08;http://www.codewars.com&#xff09;。注册了一个账号&#xff0c;花了几天的茶余饭后时间做题&#xff0c;把等级从8级升到了7级。本文的目的主要介绍使用感受及相应题目&#xff0c;可供大家参考。 新人注册为8级&#xf…

codewar 代码练习2——7级晋升6级

7级晋升到6级的过程中以做6级题以及以前未完成的题目为主&#xff0c;一般选择算法题或者基础题。相比之前从8级升级7级&#xff08;参见此博客&#xff1a;http://blog.csdn.net/m0_37324740/article/details/78408249&#xff09;的难度有所提前&#xff0c;并且一些题目结合…