Html 如何使我的徽标和h1元素移动响应
这是完整的css代码。在平板电脑和电脑上,它看起来不错,但在网站发布时,在移动设备上就不行了。徽标和h1没有响应。这是完整的css代码。在平板电脑和电脑上,它看起来不错,但在网站发布时,在移动设备上就不行了。徽标和h1没有响应Html 如何使我的徽标和h1元素移动响应,html,css,responsive-design,Html,Css,Responsive Design,这是完整的css代码。在平板电脑和电脑上,它看起来不错,但在网站发布时,在移动设备上就不行了。徽标和h1没有响应。这是完整的css代码。在平板电脑和电脑上,它看起来不错,但在网站发布时,在移动设备上就不行了。徽标和h1没有响应 body { margin: 0; padding: 0; } /* header */ .logo-img { width: 420px; } h1 { text-align: right; font-family: 'Abel', sans-s
body {
margin: 0;
padding: 0;
}
/* header */
.logo-img {
width: 420px;
}
h1 {
text-align: right;
font-family: 'Abel', sans-serif;
font-size: 35px;
margin-top: 20px;
color: #1a1a1a;
text-transform: uppercase;
}
h2 {
text-align: right;
font-family: 'Abel', sans-serif;
font-size: 21px;
color: #1a1a1a;
font-weight: 100;
text-transform: uppercase;
letter-spacing: 6px;
}
.line {
width: 97.5%;
}
/* end header */
/* content */
.main-img {
width: 100%;
}
p {
text-align: center;
margin-top: 10px;
font-family: 'Quicksand', sans-serif;
font-size: 20px;
font-weight: 100;
color: #1a1a1a;
}
.copy {
font-size: 15px;
font-weight: 100;
font-family: 'Quicksand', sans-serif;
}
/* #map {
width: 55%;
height: 200px;
box-sizing: border-box;
text-align: right;
} */
/* end content */
/* footer */
.footer-img {
width: 350px;
margin-right: 15px;
}
h3 {
text-align: center;
font-family: 'Abel', sans-serif;
font-size: 30px;
color: #5d75ab;
text-decoration: none;
margin-top: 10px;
text-transform: uppercase;
}
h4 {
text-align: center;
margin-top: 30px;
text-transform: uppercase;
letter-spacing: 2px;
font-family: 'Abel', sans-serif;
font-size: 24px;
font-weight: 100;
color: #1a1a1a;
}
h5 {
text-align: center;
margin-top: 30px;
font-family: 'Quicksand', sans-serif;
font-size: 20px;
font-weight: 100;
color: #1a1a1a;
}
a href {
text-align: center;
}
a:link {
color: #5d75ab;
text-decoration: none;
}
a:visited {
color: #5d75ab;
text-decoration: none;
}
a:hover {
color: #5d75ab;
text-decoration: none;
color: #1a1a1a;
}
a:active {
color: #5d75ab;
text-decoration: none;
}
.footer-img-container,
.top-row {
margin-top: 30px;
}
.link {
text-align: center;
display: block;
}
/* end footer */
/* Mobile Phone Responsiveness - Nexus 5 */
@media screen and (max-width: 414px) {
h1 {
font-size: 14px !important;
line-height: 80%;
margin-top: 10px;
}
h2 {
font-size: 11px;
letter-spacing: 1.2px;
}
p {
font-size: 12px;
}
h3 {
font-size: 16px;
}
h4 {
font-size: 10px;
}
h5 {
font-size: 11px;
}
.logo-img {
width: 180px;
position: absolute;
}
.main-img {
width: 100%;
}
.footer-img {
width: 100%;
}
.line {
width: 90%;
}
.copy {
font-size: 10px;
font-weight: 100;
font-family: sans-serif;
}
}
/* Tablet Responsiveness - IPad */
@media screen and (min-width:416px) and (max-width: 768px) {
h1 {
font-size: 25px;
margin-top: 0px;
}
h2 {
font-size: 20px;
letter-spacing: 2px;
}
p {
font-size: 16px;
}
h3 {
font-size: 22px;
}
h4 {
font-size: 18px;
}
h5 {
font-size: 12px;
}
.logo-img {
width: 250px;
position: absolute;
}
.main-img {
width: 100%;
}
.footer-img {
width: 100%;
}
.line {
width: 95%;
}
.copy {
font-size: 12px;
font-weight: 100;
font-family: sans-serif;
}
}
您可以使用引导映像响应类
<a href="index.html"><img src="images/logo.png" alt="logo" class="img-responsive"/> </a>
徽标显示在此处
您可以尝试以下方法,如果图像宽度为400px,则使用:
@media screen and (max-width: 400px) {
img {
width: 100%;
}
}
您可能需要为img使用不同的选择器,如果您设置了宽度,则在其他CSS中设置宽度的选择器也是相同的
如果标题位于桌面上的图像旁边,则可以将其置于图像上方。
/*桌面响应*/
.logo img{
宽度:260px;
}
h1{
字体大小:58px!重要;
线高:80%;
边缘顶部:10px;
}
/*手机响应能力*/
@媒体屏幕和屏幕(最大宽度:360px){
h1{
字体大小:12px!重要;
线高:80%;
边缘顶部:10px;
}
氢{
字体大小:9px;
字母间距:1.2px;
}
p{
字体大小:12px;
}
h3{
字体大小:16px;
}
h4{
字号:8px;
}
h5{
字体大小:11px;
}
.logo img{
宽度:160px;
位置:绝对位置;
}
.主img{
宽度:100%;
}
.footer img{
宽度:100%;
}
.线路{
宽度:90%;
}
.复制{
字体大小:10px;
字号:100;
字体系列:无衬线;
}
}
弗里戈MMB
Hlajenje&Klimatizacija
011.8525636 | 063.7591345
尝试使用与图像相同的media query max width(媒体查询最大宽度)和内部putwidth:100%
,这样,如果屏幕更宽,它将根据宽度进行缩放。我不确定如何操作。你能给我解释一下密码吗。谢谢,媒体查询位于主css下方。但出于某种原因,这是行不通的。其他一切都是从标志和h1的响应部分。还有其他建议吗?谢谢你,嘿,乔姆拉,我添加了一个你可以查看的代码片段示例。这在360px以下和360px以上都有响应。如果仍然有问题,请检查媒体查询代码上方的花括号。如果我发布整个代码,请检查代码是否有帮助。像这样,我正在努力理解你想告诉我什么。谢谢,这对我不起作用。如果我发布整个代码会有帮助吗?