html - 带有 CSS 编码的 HTML
问题描述
晚上好,目前我正在处理一些我无法解决的问题。当前网站看起来像点击这里。我的问题是
- 在顶部,我想超级酷的标语会去这里更接近艺术商店这个文本目前在正文中为 h2。艺术商店是h1
- 在底部,我需要最近的收购位于左上角,三张图片位于最近的收购下方。无论我尝试什么最近的收购永远不会进入页脚框背景的左上角。当前在页脚和图像中的最新收购也在页脚中。
- 图片周围的边框。
有人可以帮忙吗。我相信这很容易解决,但我是新手。
下面是我的代码
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="utf-8">
<title>Art Store</title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Merriweather:wght@300&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="reset.css" />
<link rel="stylesheet" href="Chapter04-Project03.css" />
</head>
<body>
<header>
<h1>Art Store</h1>
<h2>Super cool tagline will go here</h2>
</header>
<article>
<h2>Still Waiting</h2>
<p>Our website will be live in</p>
<p id="time">4 years, 3 months, and 2 days</p>
<h3>*hopefully</h3>
</article>
<footer>
<Text>Recent Acquisitions</text>
<img src="images/07020.jpg" alt="This is a test" />
<img src="images/05030.jpg" alt="This is a test" />
<img src="images/106020.jpg" alt="This is a test" />
</footer>
</body>
</html>
然后这是我的css代码
h1, h2, h3, nav, footer, .actions
{
font-family: 'Merriweather', serif;
}
body
{
font-family: 'Merriweather', serif;
font-size: 100%;
background: #150b09 url(images/art-background4.jpg) no-repeat;
background-size: cover;
}
header
{
margin-left: 8rem;
background-color: rgba(33, 33, 33,0.5);
width: 28rem;
height: 8rem;
padding: 1rem;
padding-top: 2rem;
color: white;
filter: drop-shadow(0 -6mm 4mm rgb(33,35,33,0.5));
}
header h2
{
font-size: 0.75rem;
}
header h1
{
font-family: 'Merriweather', serif;
font-size: 3rem;
background-color: (33,33,33,0.5);
}
article
{
background-color:rgba(255,255,255,0.5);
margin-top: 6rem;
margin-right: 0rem;
margin-bottom: 0rem;
margin-left: 8rem;
width: 30rem;
}
article p
{
padding-top: 2rem;
padding-right: 1rem;
padding-bottom: 0rem;
padding-left: 1rem;
font-size: 1.4rem;
font-weight: bold;
}
article h2
{
background-color:rgba(224,224,224,0.5);
padding: 1rem;
font-size: 1.5rem;
}
article h3
{
font-family: 'Merriweather', serif;
color: red;
}
article p#time
{
color: white;
background-color:rgba(66,66,66,0.5);
margin: 1rem;
padding: 1rem;
font-size: 1.2rem;
font-weight: bold;
width: 19rem;
}
footer text
{
padding-top: 1rem;
}
footer img
{
img-align: top;
}
footer
{
background-color: rgba(33,33,33,0.5);
margin-top: 6rem;
margin-right: 0rem;
margin-bottom: 0rem;
margin-left: 8rem;
width: 30rem;
color: white;
filter: drop-shadow(0 -6mm 4mm rgb(33,33,33,0.5));
text-align: bottom;
}
解决方案
您可以使用 css 为标题添加边距和填充
h1,h2{
margin:0;
padding:0;
}
您可以在图像之前添加中断行。
<Text>Recent Acquisitions</text>
<br>
<img src="images/07020.jpg" alt="This is a test" />
您可以使用 CSS 添加边框
img {
border: 5px solid #555;
}
你也应该检查一下,这样你就可以让倒数计时器自动工作。https://www.w3schools.com/howto/howto_js_countdown.asp
推荐阅读
- postgresql - 分析在 postgreSQL 中将文件上传到 API 时产生的错误
- gatling - 加特林检查soap响应是否包含节点
- java - 设备进入睡眠模式时服务无法正常工作
- python - 熊猫在 groupby 对象上应用 groupby
- kubernetes - GCE Ingress 未从就绪探测中获取健康检查
- python - 提供在烧瓶应用程序中下载 mpld3 图作为图像的选项
- ios - 从 SCNScene url 获取下载进度
- java - Swing - 从 JFileChooser 中选择的 JTree 多个根文件夹
- navision - 尝试将 PowerApps 与 Microsoft Navision 2016 连接时总是遇到以下错误
- geolocation - 地理定位中没有出现蓝点(Ionic 3)