- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个问题。我有一个 div,在这个 div 中还有一个带有文本“Benjamin”的 div。字体大小为 7vh。当我检查 galaxy s4 mini 上的网站时,文本的位置和大小都正确。当我用 galaxy a5 检查网站时,文本位置错误。我用 iPhone 4 和 5 检查网站。它总是正确的。只有 galaxy a5 告诉我错误。我们使用相同版本的 Chrome。
http://www.benwillgruber.com/stefanseite/test/index.php --> 站点 http://www.benwillgruber.com/stefanseite/test/wrong_galaxy_a5.jpg-- > 错误的位置 http://www.benwillgruber.com/stefanseite/test/google_nexus_10_emulator.png --> 对了一个 http://www.benwillgruber.com/stefanseite/test/galaxy_s4_mini.png --> 正确的。
CSS:
* { box-sizing: border-box;}
body {
background-color: #3C3C3B; /* Dunkel Grau */
padding: 0px;
margin: 0px;
overflow: hidden;
width: 100vw;
}
/* Willkommenseite */
#startseite {
width: 100vm;
height: 100vh;
overflow: hidden;
}
#spalte1reihe1 {
width: 25vw;
height: 22vh;
float: left;
background-color: #ECECEC; /* Grau */
}
#spalte2reihe1 {
width: 50vw;
height: 22vh;
float: left;
background-color: #ffffff;
}
#spalte3reihe1 {
width: 25vw;
float: left;
height: 22vh;
background-color: #ECECEC; /* Grau */
}
/* Willkommenseite Benjamin Willgruber */
#spalte1reihe2 {
width: 25vw;
height: 16vh;
float: left;
background-color: #2DAB66; /* Grün */
}
#spalte2reihe2 {
width: 50vw;
height: 16vh;
float: left;
background-color: #3C3C3B;
}
#spalte3reihe2 {
width: 25vw;
float: left;
height: 16vh;
background-color: #2DAB66; /* Grün */
}
/* Willkommenseite kombiniert mit */
#spalte1reihe3 {
width: 25vw;
height: 17vh;
float: left;
background-color: #ECECEC; /* Grau */
}
#spalte2reihe3 {
width: 50vw;
height: 17vh;
float: left;
background-color: #ffffff;
}
#spalte3reihe3 {
width: 25vw;
float: left;
height: 17vh;
background-color: #ECECEC; /* Grau */
}
/* Willkommenseite Gumhalter Stefan */
#spalte1reihe4 {
width: 25vw;
height: 16vh;
float: left;
background-color: #1E788B; /* Blau */
}
#spalte2reihe4 {
width: 50vw;
height: 16vh;
float: left;
background-color: #3C3C3B;
}
#spalte3reihe4 {
width: 25vw;
float: left;
height: 16vh;
background-color: #1E788B; /* Blau */
}
#spalte1reihe5 {
width: 25vw;
height: 29vh;
float: left;
background-color: #ECECEC; /* Grau */
}
#spalte2reihe5 {
width: 50vw;
height: 29vh;
float: left;
background-color: #ffffff;
}
#spalte3reihe5 {
width: 25vw;
float: left;
height: 29vh;
background-color: #ECECEC; /* Grau */
}
#benjaminwillgruber {
float: left;
width: 50%;
height: 16vh;
padding-left: 10px;
overflow: hidden;
border: 1px solid #ff0000;
}
#grafikmediendesign {
float: left;
width: 50%;
height: 16vh;
text-align: right;
padding-right: 10px;
overflow: hidden;
border: 1px solid #ff0000;
}
#benjamin {
font-size: 7vh;
color: #ffffff;
}
#willgruber {
font-size: 7vh;
color: #ffffff;
}
#grafik {
font-size: 7vh;
color: #ffffff;
}
#mediendesign {
font-size: 7vh;
color: #ffffff;
}
/* Auflösung 300 bis 500 */
/* Seitliche Balken werden ausgeblendet */
@media only screen and (min-width: 0px) and (max-width: 1000px)
{
#spalte1reihe1 {
display: none;
}
#spalte2reihe1 {
width: 100vw;
}
#spalte3reihe1 {
display: none;
}
#spalte1reihe2 {
display: none;
}
#spalte2reihe2 {
width: 100vw;
}
#spalte3reihe2 {
display: none;
}
#spalte1reihe3 {
display: none;
}
#spalte2reihe3 {
width: 100vw;
}
#spalte3reihe3 {
display: none;
}
#spalte1reihe4 {
display: none;
}
#spalte2reihe4 {
width: 100vw;
}
#spalte3reihe4 {
display: none;
}
#spalte1reihe5 {
display: none;
}
#spalte2reihe5 {
width: 100vw;
}
#spalte3reihe5 {
display: none;
}
}
HTML:
<!DOCTYPE html>
<html lang = "de">
<head>
<title>Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset = "utf-8">
<link rel = "stylesheet" href = "./css/style.css">
<style type = "text/css">
@font-face {
font-family: 'avril';
src: url('./font/arvil_sans-webfont.eot');
src: url('./font/arvil_sans-webfont.eot?#iefix') format('embedded-opentype'),
url('./font/arvil_sans-webfont.woff2') format('woff2'),
url('./font/arvil_sans-webfont.woff') format('woff'),
url('./font/arvil_sans-webfont.ttf') format('truetype'),
url('./font/arvil_sans-webfont.svg#arvil_sans-webfont') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'sensation';
src: url('./font/sansation_regular-webfont.eot');
src: url('./font/sansation_regular-webfont.eot?#iefix') format('embedded-opentype'),
url('./font/sansation_regular-webfont.woff2') format('woff2'),
url('./font/sansation_regular-webfont.woff') format('woff'),
url('./font/sansation_regular-webfont.ttf') format('truetype'),
url('./font/sansation_regular-webfont.svg#sansation_regular-webfont') format('svg');
font-weight: normal;
font-style: normal;
}
</style>
</head>
<body>
<div id = 'startseite'>
<div id = "reihe1">
<div id = "spalte1reihe1">
</div>
<div id = "spalte2reihe1">
</div>
<div id = "spalte3reihe1">
</div>
</div>
<div id = "reihe2">
<div id = "spalte1reihe2">
</div>
<div id = "spalte2reihe2">
<div id = 'benjaminwillgruber'>
<div id = 'benjamin'>
<font style = "font-family: 'avril'">Benjamin</font>
</div>
<div id = 'willgruber'>
<font style = "font-family: 'avril'">Willgruber</font>
</div>
</div>
<div id = 'grafikmediendesign'>
<div id = 'grafik'>
<font style = "font-family: 'avril'">Grafik</font>
</div>
<div id = 'mediendesign'>
<font style = "font-family: 'avril'">Mediendesign</font>
</div>
</div>
</div>
<div id = "spalte3reihe2">
</div>
<div id = "reihe3">
<div id = "spalte1reihe3">
</div>
<div id = "spalte2reihe3">
</div>
<div id = "spalte3reihe3">
</div>
</div>
<div id = "reihe4">
<div id = "spalte1reihe4">
</div>
<div id = "spalte2reihe4">
</div>
<div id = "spalte3reihe4">
</div>
</div>
<div id = "reihe5">
<div id = "spalte1reihe5">
</div>
<div id = "spalte2reihe5">
</div>
<div id = "spalte3reihe5">
</div>
</div>
</div>
</div>
</body>
</html>
最佳答案
因为我不能评论...文本在标准页面上没有正确对齐(我假设这只适用于移动设备?)
我假设屏幕尺寸与 A5 和 s4 不同。您可能必须使用媒体查询来确保文本根据可用的屏幕尺寸正确显示。您发布的 CSS 是您的全部 CSS 代码吗?
(再次...我想将此作为评论发布,但我没有代表。我愿意提供帮助,只是需要更多信息。
关于html - 响应式设计 - 不同字体大小的星系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33376318/
你知道更好的写法吗 font = font ? font : defaultFont; 我所知道的是: if(!font) { font = defaultFont } 我知道这是一个小工具问
我正在编写代码,但无法编译,即使类(字体)已通过 import javafx.scene.text.*; 导入我知道这个方法font包含在字体中。 这是我的代码: package helloworld
我已经构建了一个按钮,但在格式设置(即平方、内联文本等)方面遇到了问题 我目前的问题是:正文分为2部分- 上线正常-下一行是较大的字体大小 我的动画 react 正确,但文本应该在箭头的顶线和底线内。
好的,所以我想在网页上使用固定系统作为字体。我可以使用 Cufon,但我希望人们能够在鼠标悬停时选择文本并复制它。 有人有什么吗? 最佳答案 我使用 fontsquirrel 的 @font-face
我找到了 iOS 4.2 可用字体列表(链接 here ),但该列表与早期版本的 SDK 略有不同(链接 here )。 我可以很好地更改代码中的字体,但如果我使用 iOS 4.2 列表中可用的字体,
我正在尝试更改 TableView 标题上的字体颜色,其中显示“加利福尼亚/纽约”。我该怎么做? 在黑色背景上,文本需要是白色的,但无法弄清楚这一点。 谢谢 最佳答案 如果您尝试更改标题颜色,可以使用
假设我想使用 java.awt.Graphics.drawString(String str, int x, int y)在某些特定坐标处绘制字符串的方法,例如 (300, 300)。然而drawSt
我想使用Puppeteer从HTML字符串生成图像。现在我有这样的事情: const html = _.template(` Hello {{ test }}!
我正在创建一个游戏。我有一些带有文本的用户界面。最近我们想添加日语版本,但我遇到字体问题。我使用 stb_freetype 来光栅化字体,并且我支持 Unicode,所以这应该不是问题。但大多数字体似
我可以在一个文本区域中使用不同的前景色吗?不同的字体? 我想添加类似“hh:mm:ss 昵称:消息”的内容,时间为灰色,名称 - 蓝色,消息 - 黑色。 最佳答案 我在评论中犯了一个错误:你想要的是
每次我更改字体时,它都会返回到默认大小,即 12,即使我之前使用“ Jade 野”菜单更改它,它每次也只会返回到 12,我的猜测是这样我使用deriveFont()更改大小,但现在没有其他方法可以更改
我的电脑上安装了一种名为“BMW1”的自定义字体。我试图循环遍历此字体中的所有条目并将它们显示在 JTextArea 中。 我有以下代码: JTextArea displayArea = new JT
我尝试通过 Squirrel 理解生成的代码,这里是输出: @font-face { font-family: 'someFont'; src: url('someFont.eot')
我知道有多种方法可以通过 JS/DHTML 动态更改网页的字体属性,或者用 Flash 呈现的字体(使用 sIFR 或 Cufon)替换文本。但是,我找不到任何根据用户选择动态更改网页上使用的字体的好
使用具有非标准样式名称(例如“Inline”或“Outline”)而不是标准样式(例如“Bold”和“Italic”)的字体系列,如何使用 css 选择字体的不同样式? 设置 font-family
我对 html/css 有点陌生,我正在制作我的第一个网站,但我只是想不通一些东西。 首先,我在 dreaweaver 中工作...在 dreaweaver 中,一切看起来都不错,但是当我预览时,我缺
有没有办法在 Allegro5 中只绘制(或显示)图像/字体的一部分? 例如,如果我有一个正方形 A 和一个图像 B,我只想绘制/显示 B 中与 A(在本例中为 C)重叠的部分,我该怎么做? 插图:
所以,我有一个正在生成的报告 html 文件,其中有需要白色文本/字体的黑框。在通用 html 显示中一切都很好,但是当我尝试打印页面时,ctrl + p 或自定义打印功能,文本/字体保持为标准颜色,
我正在尝试制作一个非常适合 LaTeX 文档的 matlab 图形。一个已知的问题是 XTickLabel 和 YTickLabels 不使用 LaTeX 解释器渲染,导致图形不好看。 (注意:我意识
我需要在一个公共(public)位置使用默认颜色和字体,以便在桌面应用程序的多个窗口窗体中使用它。 这方面的最佳做法是什么? 我正在考虑使用应用程序设置在那里定义它们,但我想确保这是推荐的方法或者是否
我是一名优秀的程序员,十分优秀!