gpt4 book ai didi

html - 无法为 div 元素分配 css 规则

转载 作者:行者123 更新时间:2023-11-28 00:13:12 24 4
gpt4 key购买 nike

我尝试使用 ID 选择器向 div 元素添加一些 css 规则但它什么都不做..

这是我的代码的结果: enter image description here

* {
box-sizing: border-box;
}

body {
margin: 0;
font-family: Arial;
}

#header {
background: #DEDEDE;
}

.flex-container {
display: flex;
}

#header .flex-container {
flex-flow: row nowrap;
justify-content: center;
align-items: center;
width: 1028px;
margin: 0 auto;
/* put the container on the middle */
}

#header .flex-container #logoPicture {
width: 50%;
border: solid;
margin-top: 10px;
margin-bottom: 10px;
}

#tal {
border: solid;
}

#header .flex-container img {
vertical-align: middle;
border-radius: 20%;
}

#header .flex-container #logo {
font-family: "Bauhaus 93";
font-size: 350%;
color: #E83303;
}

#header .flex-container ul {
padding-left: 0;
/* avoud the default padding to the left */
font-family: "Franklin Gothic", Tahoma;
}

#header .flex-container ul li {
display: inline-block;
padding: 11px 25px;
margin: 3px;
background: #E83303;
border-radius: 10px;
font-weight: bold;
}
<div id="header">
<div class="flex-container">
<div id="logoPicture">
<img src="https://i.imgur.com/cvO9xwB.png">
</div>
<div id="logo">RAPITEC</div>
<div id="tal">
<ul>
<li>Home</li>
<li>About</li>
<li>Shop</li>
<li>Contact us</li>
</ul>
</div>
</div>
</div>

最佳答案

代替:

#tal {
border: solid;
}

尝试:

#tal {
border: 1px solid black;
}

你也可以这样写:

#tal {
border-width: 1px;
border-style: solid;
border-color: black;
}

将代码放入 Codepen 时,我看到一个边框(Mac 上的 Chrome 和 Firefox)。看来我们的默认 border-width 和/或 border-color 值不同。最好具体说明这两件事。

关于html - 无法为 div 元素分配 css 规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55267741/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com