2016-11-17 49 views
-1

在我脑子里,我想用“你的形象比我们更重要。”有更重要的重点。标题生成

我也想,要带下划线和阴影,以配合红色背景(白色阴影)。这也加重我辩论是否应该闪烁或淡出。

出于某种原因,我的CSS不工作就可以了。 HTML代码:

<!-- This is a HTML Document--> 

    <head> 
     <meta charset="utf-8"> 
     <meta name="viewport" content="width=device-width, initial-scale=1"> 
     <link rel="stylesheet" href="dld.css"> 
     <title>Dave's Logo Designs</title> 
    </head> 
    <header> 
     <div id="header"> 
      <h1>Your Image is <em>More Important</em> Than Ours</h1> 
     </div> 
    </header> 
    <body> 
     <h1>Welcome to the official site of Dave's Logo Designs<h1> 
    </body> 
    </html> 

CSS到目前为止:

header { 
     width: 100%; 
     height: 200px; 
    } 
    header:h1 { 
     color: red; 
     text-shadow: 0px 2px 2px white; 
     font-size: 25px; 
     font-family: impact; 
    } 
    header:em { 
     color: white; 
     font-weight: bold; 
     text-decoration: underline; 
     font-size: 30px; 
     font-family: impact; 
    } 

没有的工作。可能在我的结局上有些愚蠢。我在这里先向您的帮助表示感谢。

+2

你应该把''

你''标签内。 –

+0

选择器也应该是'的#header> h1'和'的#header em'。 – Gavin

+0

非常感谢。我在飞行中学习。希望我能理清这一点。 –

回答

0

你应该把YOUT body标签内header标签。

<html> 
    <head> 
     <meta charset="utf-8"> 
     <meta name="viewport" content="width=device-width, initial-scale=1"> 
     <link rel="stylesheet" href="dld.css"> 
     <title>Dave's Logo Designs</title> 
    </head> 
    <body> 
     <header> 
      <div id="header"> 
       <h1>Your Image is <em>More Important</em> Than Ours</h1> 
      </div> 
     </header> 
     <h1>Welcome to the official site of Dave's Logo Designs<h1> 
    </body> 
</html> 

,改变你的CSS选择器

header { 
    width: 100%; 
    height: 200px; 
} 

header h1 { 
    color: red; 
    text-shadow: 0px 2px 2px white; 
    font-size: 25px; 
    font-family: impact; 
} 

header em { 
    color: white; 
    font-weight: bold; 
    text-decoration: underline; 
    font-size: 30px; 
    font-family: impact; 
} 

headerh1之间的空间。

它会导致像这样(深绿色背景添加显示斜体文本是白色的)。

enter image description here

+0

我有一个黑色的背景,红色文本H1去,黄色为重点,拿出下划线和阴影。我还在图像下方插入了我的徽标。我认为它看起来不错。我似乎无法让它正确地居中。 –

+0

@ Dave的Logo设计为了居中,只需添加'display:block; text-align:center;'进入'header h1' –

+0

当涉及到我网站上的所有项目时,我应该使用div来处理所有项目吗? –