html - 试图移动标题但无法正确获取代码
问题描述
谁能帮我写代码?我正在尝试将h3
页眉移动到页面的右侧,但似乎无法移动。所附图片是它现在的位置以及我希望它在哪里。
<!DOCTYPE html>
<html lang="en"><head>
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link href="https://www.carymcclure.com/public_html/favicon.ico?v=1" rel="shortcut icon"
type="image/x-icon" />
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="004c30">
<style>
body {
background-image: url("../img/ivyt.gif");
background-repeat: no-repeat;
width: 1930px;
height: 8867px;
}
</style>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Welcome to Cary McClures' Portfolio</title>
<!-- Bootstrap -->
<link href="../css/bootstrap-4.4.1.css" rel="stylesheet">
</head>
<body>
<a href="../pdf/IVY Academic Transcript.pdf" style="position: absolute; left: 1608px; z-index:
50; width: 248px; top: -86px; height: 233px;"><img style="float:right;margin-
top:250px;position: relative;"
src="../img/ivy logo.gif" width="150" height="150" alt="email"></a>
<h3> Click Logo to Download</h3>
<h3 style="color: white;"></h3>
</body>
</html>
解决方案
将 afloat: right;
应用于<h3>
元素
body {
background-image: url("../img/ivyt.gif");
background-repeat: no-repeat;
width: 1930px;
height: 8867px;
}
h3 {
float: right;
}
<!DOCTYPE html>
<html lang="en"><head>
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link href="https://www.carymcclure.com/public_html/favicon.ico?v=1" rel="shortcut icon"
type="image/x-icon" />
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="004c30">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Welcome to Cary McClures' Portfolio</title>
<!-- Bootstrap -->
<link href="../css/bootstrap-4.4.1.css" rel="stylesheet">
</head>
<body>
<a href="../pdf/IVY Academic Transcript.pdf" style="position: absolute; left: 1608px; z-index:
50; width: 248px; top: -86px; height: 233px;"><img style="float:right;margin-
top:250px;position: relative;"
src="../img/ivy logo.gif" width="150" height="150" alt="email"></a>
<h3> Click Logo to Download</h3>
<h3 style="color: white;"></h3>
</body>
</html>
推荐阅读
- javascript - CSS动画完成后不断重置
- openshift - 为什么将 Argo CD 与 Tekton 结合使用
- c++ - clang-query:检查函数参数类型的模板参数的名称
- bash - 有没有办法同时检查一个字段是否等于 bash 中的 600+ 个不同的值?
- javascript - 检查 ngIf 角度指令中的字符串列表中是否存在字符串的有效方法是什么
- reactjs - useRef、useMemo、useCallback 钩子的生产用例是什么?
- typescript - 为什么这两个映射元组类型不相等?
- java - 如何从包含具有重复参数名称的方法的 .WSDL 文件创建 Java SOAP Web 服务?
- c# - 尽管模型有效,但 TryValidateModel 返回 false
- reactjs - 用 onClick 反应 useCallback 不起作用。渲染子组件