问题描述
我想,我正在做一些琐碎的完全错误的事情。 我是CSS和HTML的新手,尝试在网页顶部使用居中的TEXT和图像 我成功地使用了3个盒子使用flex box容器布局 但是我无法将下一个div置于flex框下方的中央。 所有其他线都在弹性盒容器的第三个盒子下面居中。
检查我的代码和输出 https://codepen.io/alex1965/pen/eYZLQQG
<!DOCTYPE html>
<html>
<head>
<title>Hello Jtronicx</title>
<style>
/*default version*/
@font-face {
font-family:"Jtronicxfont";
src: url("fonts/alien-encounters-regular.ttf");
font-weight:normal;
}
/*bold version*/
@font-face {
font-family:"Jtronicxfont";
src: url("fonts/alien-encounters-bold.ttf");
font-weight:bold;
}
body {
background-color: black;
}
.flex-container {
display: flex;
flex-wrap: nowrap;
writing-mode: horizontal-tb;
justify-content: center;
background-color: black;
}
.flex-container > div {
background-color: black;
width: 100px;
height: 100px;
margin: 10px;
}
#company{
color: DarkKhaki;
text-align: center;
font-family:"Jtronicxfont";
font-weight: bold;
font-size:90px;
margin-bottom:2px;
}
a:link,a:visited {
text-decoration: none;
background-color: rgb(38,31,5);
color: DarkKhaki;
font-family:"Jtronicxfont";
font-weight:normal;
font-size: 130%;
text-align: center;
display:block;
width:200px;
padding: 3px;
border: 1px solid rgb(117,104,50);
border-radius: 13px;
margin-bottom:2px;
}
a:hover {
background-color: rgb(45,37,5);
color: Khaki;
cursor:pointer;
}
div {
display:block;
text-align:center;
color:DarkKhaki;
font-family:"Arial";
font-weight: normal;
font-size:20px;
}
</style>
</head>
<body>
<div class="flex-container">
<div></div>
<div id="company" style="flex-basis: 600px">Jtronicx bv</div>
<div><img src="jtronicx.jpg" width="80" height="70"><div>
</div>
<div class="offerings">
<div>industrial business development</div>
<div>proof of concepts</div>
<div>electronics integration</div>
<div>web design</div>
<div>
<ul>
<li><a href="http://www.jtronicx.com">Company</a></li>
<li><a href="http://www.jtronicx.com">What I offer</a></li>
<li><a href="http://www.jtronicx.com">Projects</a></li>
<Li><a href="http://www.jtronicx.com">Contact</a></Li>
</ul>
</body>
</html>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)