Html 标题不为';不能与背景img一起工作
我要重新设计我的网站。在Html 标题不为';不能与背景img一起工作,html,css,image,web,background,Html,Css,Image,Web,Background,我要重新设计我的网站。在Bodycss中,我放置了背景img。当然,我为标题做了一个divclass=“header” 但是当我发布页面时,标题不会显示。我试过几种浏览器和电脑,但都没看到。 然后我试着打电话。在手机上,它只能在纵向模式下工作,但不能像在桌面上那样在横向模式下工作。在iPad上也是如此 <!doctype html> <html lang="en"> <head> <meta charset="utf-8
Body
css中,我放置了背景img。当然,我为标题做了一个divclass=“header”
但是当我发布页面时,标题不会显示。我试过几种浏览器和电脑,但都没看到。
然后我试着打电话。在手机上,它只能在纵向模式下工作,但不能像在桌面上那样在横向模式下工作。在iPad上也是如此
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Home</title>
<style type="text/css">
* {padding: 0; margin: 0;}
body {background: url(http://farm4.staticflickr.com/3785/9603354598_e7a32b5505_o.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; }
.header {margin-top: 50px; width: 1400px; position:fixed; height: 70px; background-color:rgba(0,0,0,0.5); /* Fallback for web browsers that doesn't support RGBa */ background: rgb(0, 0, 0) transparent; /* RGBa with 0.6 opacity */ background: rgba(0, 0, 0, 0.6); /* For IE 5.5 - 7*/ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000); /* For IE 8*/ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)"; color: white; margin-top: 80%; }
.titles {opacity: 1; font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-weight: 300;}
.title {margin-top: 10px; margin-left: 2%; font-size: 40px; font-family: Futura, "Trebuchet MS", Arial, sans-serif;}
.subtitle {margin-top: -12px; margin-left: 130px; font-size: 10px; font-family: Futura, "Trebuchet MS", Arial, sans-serif;}
</style>
</head>
<body>
<div class="header">
<div class="titles" align="left">
<div class="title">TITLE</div>
<div class="subtitle">subtitle</div>
</div>
</div>
</body>
</html>
家
*{填充:0;边距:0;}
正文{背景:url(http://farm4.staticflickr.com/3785/9603354598_e7a32b5505_o.jpg)无重复中心已修复;-webkit背景大小:cover;-moz背景大小:cover;-o-background-size:cover;背景大小:cover;}
.header{margin top:50px;width:1400px;position:fixed;height:70px;背景色:rgba(0,0,0,0.5);/*不支持rgba的web浏览器的回退*/背景:rgb(0,0,0,0)透明;/*不透明度为0.6的rgba*/背景:rgba(0,0,0,0,0.6);/*用于IE 5-7*/过滤器:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000,endColorstr=#99000000);/*用于IE 8*/-ms过滤器:“progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000,endColorstr=#99000000)”;颜色:白色;页边距顶部:80%;)
标题{不透明度:1;字体系列:“HelveticaNeue Light”、“Helvetica Neue Light”、“Helvetica Neue”、“Helvetica Neue”、Helvetica,Arial,“Lucida Grande”,无衬线;字体重量:300;}
.title{页边空白顶端:10px;左边空白:2%;字体大小:40px;字体系列:Futura,“投石机MS”,Arial,无衬线;}
.副标题{页边空白顶部:-12px;左边空白:130px;字体大小:10px;字体系列:Futura,“投石机MS”,Arial,无衬线;}
标题
字幕
知道问题出在哪里吗?
在我的代码应用程序中,页面工作得非常好
谢谢!请删除页眉css中的页边空白。我在下面的示例中对此进行了注释。请忽略我的红色边框,将其用作“调试” 检查我的
.header {
margin-top: 50px;
width: 1400px;
position:fixed;
height: 70px;
background-color:rgba(0,0,0,0.5);
/* Fallback for web browsers that doesn't support RGBa */
background: rgb(0, 0, 0) transparent;
/* RGBa with 0.6 opacity */
background: rgba(0, 0, 0, 0.6);
/* For IE 5.5 - 7*/
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);
/* For IE 8*/
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
color: white;
/* margin-top: 80%;*/
}