SO中文参考
首页
(current)
程序语言
c
java
python
c++
go
javascript
swift
c#
操作系统
linux
ubuntu
centos
unix
数据库
oracle
mysql
mongodb
postgresql
框架
node.js
angular
react-native
avalon
django
twisted
hadoop
.net
移动开发
android
ios
搜索
h1 - h6 响应式字体大小文档</desc> <question vote="0"> <p>如何更改每个 @query 大小的 h1-h6 字体大小? 我有一个像这样的简单代码:</p> <pre><code><!doctype html> <html> <head> <meta charset="UTF-8"> <title>Documento senza titolo</title> <link rel="stylesheet" type="text/css" href="katartica.com/wp-content/themes/katartika/css/bootstrap.min.css"> <style type="text/css"> body { font-size: 100%; } @media (max-width:768px){ body, h1, h2 { font-size: 1.2em; } } @media (min-width:768px){ body, h1, h2 { font-size: 3em; } } </style> </head> <body> <h1>questoèuntestomoltolungo</h1> <h2>questoèuntestomoltolungo</h2> questo è il body </body> </html> </code></pre> <p>当我尝试这样做时,h1 和 h2 会更改每个查询的大小,但它们具有相同的大小。</p> </question> <answer tick="false" vote="1"> <p>“H”标签是用 em 处理的,因此通过使用相同的“em”它们是相等的。</p> <p>W3C 建议使用这些样式作为默认样式:</p> <pre><code> h1 { font-size: 2em; } h2 { font-size: 1.5em; } h3 { font-size: 1.17em; } h4 { font-size: 1.12em; } h5 { font-size: .83em; } h6 { font-size: .75em; } </code></pre> <p>如果你想放大它们,你应该对每一个都做。</p> <p>这里有完整的用户代理样式表默认值<a href="http://css-class.com/test/css/defaults/UA-style-sheet-defaults.htm" rel="nofollow">这里</a></p> </answer> <answer tick="true" vote="0"> <p>你的<pre><code>media queries</code></pre>有冲突..你不能拥有相同大小的<pre><code>max-width</code></pre>和<pre><code>min-width</code></pre>,因此它只会选择其中之一。</p> </answer> <answer tick="false" vote="0"> <p>有两个问题可以回答你的问题:</p> <ol> <li>媒体查询不应该完全重叠,所以这样的事情会更好:</li> </ol> <p><a href="https://i.stack.imgur.com/Ao2rN.png" target="_blank"><img src="https://cdn.txt58.com/i/AWkuc3RhY2suaW1ndXIuY29tL0FvMnJOLnBuZw==" alt=""/></a></p> <ol start="2"> <li><p> h1 和 h2 的大小相同的原因是因为您在执行此操作时将它们设置为相同的大小:</p> <p><pre><code>body, h1, h2 {font-size: 3em;}</code></pre></p> </li> </ol> <p>你需要像这样分开做:</p> <pre><code>body { font-size: 1em; } h1 { font-size: 2rem; } h2 { font-size: 3em; }` </code></pre> <p>您必须为每个媒体查询执行此操作。</p> <p>将它们放在一起,你可以做到这一点:</p> <p><a href="https://i.stack.imgur.com/Ztsv4.png" target="_blank"><img src="https://cdn.txt58.com/i/AWkuc3RhY2suaW1ndXIuY29tL1p0c3Y0LnBuZw==" alt=""/></a></p> </answer> </body></html>
问题描述
投票:0
回答:0
html
css
font-size
最新问题
scp linux命令的快捷命令创建
如何在 Rust 中实现异步 Drop?
如何让 VScode 识别 d.ts 文件而不直接引用它们
Livewire 访问自定义输入元素标签值?
场景重新加载后 Unity 引用中断
python正则表达式,多行匹配,但仍想获取行号
为什么 Alpine x-data 对其自身的属性变化没有反应?
如何在COUNTUNIQUEIFS函数中使用OR逻辑?
在 STM32F407 上使用带有 CRC 和 DMA 的 SPI,什么信号表示 CRC 传输结束?
Google 表格:如何在 COUNTUNIQUEIFS 函数中使用 OR 逻辑?
为什么fish中的or操作符似乎不起作用
函数重载取决于编译时对象状态
Flutter 通知:使用 flutter_local_notifications 输入操作直接回复聊天通知
我可以从同一个客户端在同一端口上与同一服务器建立超过 1 个 TCP 连接吗?具体到端口 445
用于更改汉堡行菜单长度并添加标注的 css
将类型动态传递给 JSONDecoder
如何将 HStack 中的标签与 Form 中标签的结果对齐?
Regex - Java 中的特殊字符转义
有没有办法将一系列文本行写入网格窗口?
更高效的不透明度图像合成?
© www.soinside.com 2019 - 2024. All rights reserved.