For example, you want to share a product, a portfolio, or just inspiration on your website. Before you post it online, you want it to look attractive and professional, or at least look like it. So what should you do next? ## Text
body { margin: 0 auto; max-width: 50em; }After adding styles to the text container, how about adding styles to the text itself?
body { font-family: "Helvetica", "Arial", sans-serif; } If you insist on using serif fonts, you can try Georgia. When we make text more attractive, we also need to make it more readable.
When users feel that a page is broken, it is usually a spacing issue. You can increase the appeal of your page by providing appropriate spacing around and within text. body { line-height: 1.5; padding: 4em 1em; } h2 { margin-top: 1em; padding-top: 1em; } Although the layout has been greatly improved so far, let's add a few more details.
##
Black text on a white background will look more eye-catching. Choose a softer black for your text to make the page easier to read.
balance
Just a few extra adjustments are needed to balance the page:
main color tone
Most brands have a main color that serves as the visual tone. On a web page, this dominant color can be used to emphasize interactive elements such as links.
## Secondary color ## Main colors can be supplemented with more subtle hues, used in borders, backgrounds, and even body text. body { color: #566b78; } code, pre { background: #f5f7f9; border-bottom: 1px solid #d8dee9; color: #a7adba; } pre { border-left: 2px solid #69c; } I have changed the color tone, why not also change the shape/font... 自定义字体 由于文本是网页的主要内容,使用自定义字体能使页面更加引人注目。 当你可以嵌入自己的网页字体或使用类似Typekit的在线服务时,让我们使用免费谷歌字体Roboto: @import 'https://fonts.googleapis.com/css?family=Roboto:300,400,500'; @import 'https://fonts.googleapis.com/css?family=Roboto:300,400,500'; body { font-family: "Roboto", "Helvetica", "Arial", sans-serif; } 在通过自定义字体凸显你的个性后,增加一千个单词又怎么办呢? 图形和图标既可用来作为支持你的内容的装饰品,还可以在你想要传达的信息中担当积极部分。 让我们从Unsplash挑选一张漂亮的背景图片来美化header。 header { background-color: #263d36; background-image: url("header.jpg"); background-position: center top; background-repeat: no-repeat; background-size: cover; line-height: 1.2; padding: 10vw 2em; text-align: center; } 添加logo header img { display: inline-block; height: 120px; vertical-align: top; width: 120px; } 让我们借这个机会,来提高文本风格。 header h1 { color: white; font-size: 2.5em; font-weight: 300; } header a { border: 1px solid #e81c4f; border-radius: 290486px; color: white; font-size: 0.6em; letter-spacing: 0.2em; padding: 1em 2em; text-transform: uppercase; text-decoration: none; transition: none 200ms ease-out; transition-property: color, background; } header a:hover { background: #e81c4f; color: white; } 按照网页设计的基本原则,我们在短短几分钟内设计了一个像样的页面。只剩下最后一件事啦... |
The above is the detailed content of Quickly play with web page styles. For more information, please follow other related articles on the PHP Chinese website!

对比SpringBoot与SpringMVC,了解它们的差异随着Java开发的不断发展,Spring框架已经成为了许多开发人员和企业的首选。在Spring的生态系统中,SpringBoot和SpringMVC是两个非常重要的组件。虽然它们都是基于Spring框架的,但在功能和使用方式上却有一些区别。本文将重点对比一下SpringBoot与Sprin

CSS网页按钮设计:创建各种炫酷的按钮样式,需要具体代码示例在网页设计中,按钮是一个非常重要的元素,因为它不仅是用户和网站交互的纽带,还能够增加整体视觉效果和用户体验。而一个好的按钮样式不仅要有吸引人的外观,还需要考虑到一些功能细节,比如点击效果、悬停效果等等。本文将为大家分享一些CSS按钮设计的技巧和炫酷的样式,同时提供代码示例,希望能够帮助大家更好地设计

WordPress网站搭建指南:快速搭建个人网站随着数字化时代的到来,拥有一个个人网站已经成为了一种时尚和必要。而WordPress作为最受欢迎的网站搭建工具,让搭建个人网站变得更加容易和便捷。本文将为大家提供一个快速搭建个人网站的指南,包含具体的代码示例,希望可以帮助到想要拥有自己网站的朋友们。第一步:购买域名和主机在开始搭建个人网站之前,首先要购买自己

Vue3是目前前端界最热门的框架之一,而Vue3的生命周期函数是Vue3中非常重要的一部分。Vue3的生命周期函数可以让我们实现在特定的时机触发特定的事件,增强了组件的高度可控性。本文将从Vue3的生命周期函数的基本概念、各个生命周期函数的作用和使用方法以及实现案例等方面进行详细探究和讲解,帮助读者快速掌握Vue3的生命周期函数。一、Vue3的生命周期函数的

电脑怎么切屏?在使用电脑的时候,有的朋友会使用两个甚至三个显示屏,但是在使用的时候,就会遇到需要切换屏幕的问题,那么电脑怎么切屏呢?一些朋友不知道电脑快速切屏方法,所以本期将教大家win10电脑怎么快速切屏。win10电脑怎么快速切屏?具体的方法如下:1、外接显示屏以后,同时按下【Fn】+【F4】或者【win】+【P】即可选择外接显示器。2、第二种方法是,在桌面空白处鼠标右键,然后选择【屏幕分辨率】。3、然后在【多显示器】中,就能够切换屏幕了。以上就是小编带来的win10电脑怎么快速切屏的全部内

效率提升!PyCharm中快速注释代码的方法分享在日常的软件开发工作中,我们经常需要注释掉一部分代码进行调试或者调整。如果手动逐行添加注释,这无疑会增加我们的工作量和耗费时间。而PyCharm作为一款强大的Python集成开发环境,提供了快速注释代码的功能,大大提升了我们的开发效率。本文将分享一些在PyCharm中快速注释代码的方法,并提供具体的代码示例。单

win7如何快速截屏?win7系统之中有着很多便捷操作功能,可以为各位提供非常多样化的便捷服务。很多win7系统的用户在使用电脑的过程中,想要通过win7系统之中的快捷键进行截屏,但是却不清楚具体的快捷键是哪些,因此无法正常使用,那么,这些快捷截屏键究竟是哪些呢?下面小编就为各位带来win7快速截屏键介绍。win7快速截屏键介绍1、按Prtsc键截图这样获取的是整个电脑屏幕的内容,按Prtsc键后,可以直接打开画图工具,接粘贴使用。也可以粘贴在QQ聊天框或者Word文档中,之后再选择保存即可。2

sessionStorage在前端开发中的优势与应用案例分析随着Web应用的发展,前端开发的需求也越来越多样化。前端开发人员需要使用各种工具和技术来提高用户体验,其中,sessionStorage是一个非常有用的工具。本文将介绍sessionStorage在前端开发中的优势,以及几个具体的应用案例。sessionStorage是HTML5提供的一种本地存储方


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft
