CSS Fonts

2023-10-13 15:38
文章标签 css frontend fonts

本文主要是介绍CSS Fonts,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

代码示例(完整版):
index.html
<!DOCTYPE html>
<html>
<head><title>The Rise of Soccer in The US</title><link href="https://fonts.googleapis.com/css?family=Roboto:100" type="text/css" rel="stylesheet"><link href="https://fonts.googleapis.com/css?family=Playfair+Display" type="text/css" rel="stylesheet"><link href="style.css" type="text/css" rel="stylesheet">
</head>
<body><div class="content"><img src="https://s3.amazonaws.com/codecademy-content/courses/web-101/unit-4/htmlcss1-img_writer-avatar.jpg" class="writer-img"><h3 class="byline">Article By: Jane Dover</h3><h1>How the Rise of Soccer in the US Is Changing the Face of Youth Sports</h1><h2>The focus on soccer in youth sports programs is exploding nation-wide</h2><p>When the first World Cup arrived in the US in the 90's everyone officially declared that soccer was it. Well it's taken it's time but we can definitely see the influence of soccer, especially women's soccer, across the US. This year, 3 million kids played in youth soccer leagues with 2/3 of those leagues for girls. In fact, in the 12-17 age range the MLS has surpassed the MLB and NFL in popularity.</p><p>Part of this meteoric rise can be attributed to the impressively soaring ad dollars being pumped into the Women's World Cup games in 2014. The women's games generated $40 million for Fox, that's definitely not chump change. And those advertisers, like ATT, Coca Cola, Verizon, Nike, Visa, and other heavy hitters, are working to make sure they see those numbers grow year after year by investing in youth soccer facilities and promoting programs across the country. </p><p>Now that big business is involved you can be assured you'll see a continued rise in popularity in soccer across the country for years to come. </p></div><div class="image"><p class="caption">The local semi- pro soccer team in Seattle, WA plays an international friendly</p></div></body>
</html>style.css
body {/* Old browsers */background: #141E30;/* Chrome 10-25, Safari 5.1-6 */background: -webkit-linear-gradient(-45deg, #35577D, #141E30);/* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */background: linear-gradient(-45deg, #35577D, #141E30);margin: 0;padding: 0;
}h1 {color: #FFF;font-family:Playfair Display,serif;font-size: 32px;padding-top: 100px;text-align: left;width: 60%;text-transform:uppercase;
}h2 {border-bottom: 1px solid rgba(255, 255, 255, 0.5);color: rgba(255, 255, 255, 0.5);font-family:Roboto,sans-serif;font-weight: 100;font-size: 22px;font-style:italic;line-height: 24px;word-spacing:0.05em;letter-spacing:0.02em;padding-bottom: 30px;text-align: left;width: 70%;
}p {color: AliceBlue;font-family:Roboto,sans-serif;font-size:20px;line-height: 1.7em;font-weight:100;text-align: left;width: 100%;
}.byline {color: rgba(255, 255, 255, 0.5);float: left;font-family: 'Roboto', sans-serif;font-weight: 100;font-size: 14px;padding-left: 10px;text-transform: uppercase;
}.caption {background-color: rgba(0, 0, 0, 0.6);color: rgba(255, 255, 255, 0.65);display: block;font-family: 'Playfair Display', serif;font-size: 14px;font-style: italic;line-height: 14px;margin-left: 20px;padding: 10px;position: relative;top: 80%;width: 60%;
}.content {padding: 40px;
}.image {background-image: url("https://s3.amazonaws.com/codecademy-content/courses/web-101/unit-4/htmlcss1-img_soccer.jpeg");background-size: cover;background-position: center;height: 300px;
}.writer-img {-webkit-box-shadow: 5px 0px 5px 0px rgba(0, 0, 50, 0.97);-moz-box-shadow: 5px 0px 5px 0px rgba(0, 0, 50, 0.97);box-shadow: 5px 0px 5px 0px rgba(0, 0, 50, 0.97);float: left;width: 50px;
}


这篇关于CSS Fonts的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/204204

相关文章

CSS place-items: center解析与用法详解

《CSSplace-items:center解析与用法详解》place-items:center;是一个强大的CSS简写属性,用于同时控制网格(Grid)和弹性盒(Flexbox)... place-items: center; 是一个强大的 css 简写属性,用于同时控制 网格(Grid) 和 弹性盒(F

CSS实现元素撑满剩余空间的五种方法

《CSS实现元素撑满剩余空间的五种方法》在日常开发中,我们经常需要让某个元素占据容器的剩余空间,本文将介绍5种不同的方法来实现这个需求,并分析各种方法的优缺点,感兴趣的朋友一起看看吧... css实现元素撑满剩余空间的5种方法 在日常开发中,我们经常需要让某个元素占据容器的剩余空间。这是一个常见的布局需求

CSS Anchor Positioning重新定义锚点定位的时代来临(最新推荐)

《CSSAnchorPositioning重新定义锚点定位的时代来临(最新推荐)》CSSAnchorPositioning是一项仍在草案中的新特性,由Chrome125开始提供原生支持需... 目录 css Anchor Positioning:重新定义「锚定定位」的时代来了! 什么是 Anchor Pos

CSS中的Static、Relative、Absolute、Fixed、Sticky的应用与详细对比

《CSS中的Static、Relative、Absolute、Fixed、Sticky的应用与详细对比》CSS中的position属性用于控制元素的定位方式,不同的定位方式会影响元素在页面中的布... css 中的 position 属性用于控制元素的定位方式,不同的定位方式会影响元素在页面中的布局和层叠关

HTML5 getUserMedia API网页录音实现指南示例小结

《HTML5getUserMediaAPI网页录音实现指南示例小结》本教程将指导你如何利用这一API,结合WebAudioAPI,实现网页录音功能,从获取音频流到处理和保存录音,整个过程将逐步... 目录1. html5 getUserMedia API简介1.1 API概念与历史1.2 功能与优势1.3

全面解析HTML5中Checkbox标签

《全面解析HTML5中Checkbox标签》Checkbox是HTML5中非常重要的表单元素之一,通过合理使用其属性和样式自定义方法,可以为用户提供丰富多样的交互体验,这篇文章给大家介绍HTML5中C... 在html5中,Checkbox(复选框)是一种常用的表单元素,允许用户在一组选项中选择多个项目。本

HTML5 搜索框Search Box详解

《HTML5搜索框SearchBox详解》HTML5的搜索框是一个强大的工具,能够有效提升用户体验,通过结合自动补全功能和适当的样式,可以创建出既美观又实用的搜索界面,这篇文章给大家介绍HTML5... html5 搜索框(Search Box)详解搜索框是一个用于输入查询内容的控件,通常用于网站或应用程

CSS3中的字体及相关属性详解

《CSS3中的字体及相关属性详解》:本文主要介绍了CSS3中的字体及相关属性,详细内容请阅读本文,希望能对你有所帮助... 字体网页字体的三个来源:用户机器上安装的字体,放心使用。保存在第三方网站上的字体,例如Typekit和Google,可以link标签链接到你的页面上。保存在你自己Web服务器上的字

html 滚动条滚动过快会留下边框线的解决方案

《html滚动条滚动过快会留下边框线的解决方案》:本文主要介绍了html滚动条滚动过快会留下边框线的解决方案,解决方法很简单,详细内容请阅读本文,希望能对你有所帮助... 滚动条滚动过快时,会留下边框线但其实大部分时候是这样的,没有多出边框线的滚动条滚动过快时留下边框线的问题通常与滚动条样式和滚动行

使用vscode搭建pywebview集成vue项目实践

《使用vscode搭建pywebview集成vue项目实践》:本文主要介绍使用vscode搭建pywebview集成vue项目实践,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地... 目录环境准备项目源码下载项目说明调试与生成可执行文件核心代码说明总结本节我们使用pythonpywebv