当我的列表中的长行环绕时,我似乎无法从我的无序列表中删除缩进.这是我的列表的样子:
(点显示缩进)
我已经阅读了一堆解决方案,尝试使用text-indent,list-style将margin和padding设置为零,但没有任何效果.我认为问题是列表上方有一个我需要居中的标题,因此我将边距设置为自动,然后它会搞乱下面的列表.但即使我在父div中说两个div它也不起作用.
这是HTML/CSS(我包含了所有内容,以防有一些设置导致所有其他解决方案失败)
<div id="info">
<p><strong>Did you know you can SSH directly to ourserver.com?</strong> </p>
<ul>
<li>Windows users can use putty</li>
<li>Mac users can use the <a href="http://www.terminfo.org">Terminal.app</a></li>
<li>Linux users can use SSH userid@ourserver.com port 22</li>
<li>Or use an SFTP program like <a href="http://cyberduck.ch/">Cyberduck</a> just point it at ourserver.com, port 22</li>
</ul>
</div>
#info {
color:#FFFFFF;
width:440px;
margin-left:auto;
margin-right:auto;
border-radius: 10px;
border-style:solid;
border-width:2px;
border-color:#FFF;
padding-bottom:20px; padding-left:20px; padding-right:20px;
background-image: -webkit-gradient(linear, 0% 0%, 0% …Run Code Online (Sandbox Code Playgroud) 我不确定如何将li元素放在浅绿色空间中,仅基于我围绕它们创建的绿色正方形。截至目前,CSS包括居中时项目符号要占用的空间,我不希望这样做。
#square {
position: fixed;
width: 350px;
height: 100%;
top: 0px;
left: 0px;
background-color: rgb(230, 255, 230);
}
ul {
position: relative;
bottom: 30px;
display: flex;
flex-direction: column;
align-items: center;
}
li {
margin-top: 40px;
padding-left: 75px;
border-color: white;
border-width: 2px;
border-style: solid;
padding: 5px 20px 5px 20px;
background-color: green;
border-radius: 10px;
width: 100px;
text-align: center;
}
.navlink {
text-decoration: none;
color: white;
}Run Code Online (Sandbox Code Playgroud)
<div id="square">
<ul>
<li><a class="navlink" href="#">Introduction</a></li>
<li><a class="navlink" href="#">Middle</a></li>
<li><a class="navlink" href="#">End</a></li>
</ul>
</div> …Run Code Online (Sandbox Code Playgroud)大家好,这里是初级开发人员,我的网页遇到很多问题。
但主要的一个是我的导航链接和导航栏顶部之间的间隙。
我尝试了很多解决方案,但似乎没有一个有帮助。即使对于网站中的其他问题,我真的很感激任何帮助。请记住,该网站还远未完成,我是初学者。谢谢。
HTML:
<!DOCTYPE html>
<html>
<head>
<link href="dinnerdrone.css" rel="stylesheet"type="text/css"/>
<title>Dinner Drone Site</title>
</head>
<body>
<!-- Code for Header Navgation -->
<div id="topnav">
<ul >
<li class="link"><a href="dinnerdrone.html">Home</a></li>
<li class="link"><a href="contactus.html">Contact Us</a></li>
<li class="link"><a href="login.html">Log In</a></li>
<li class="link"><a href="signup.html">Sign Up</a></li>
<li class="link"><a href="aboutus.html">About Us</a></li>
</ul>
</div>
<!-- Code for title -->
<div id="title">
<p>Dinner Drone</p>
</div>
<!-- Code for subtitle -->
<div id="subtitle">
<p>Your favorite meals in the safest way</p>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
/* Body styles*/
body {
font-family:verdana,geneva,helvetica; …Run Code Online (Sandbox Code Playgroud) 我正在尝试完成 Odin 项目中 Flexbox 的 CSS 练习。这是自检:
自检
然而,类 left-links 的 div 中有额外的空间,这对于 HTML 或 CSS 代码中为什么存在它没有意义,因为我自己没有添加任何空间。
我尝试了很多方法将左侧链接推到左侧但无济于事。
.header {
font-family: monospace;
display: flex;
background: papayawhip;
justify-content: space-between;
padding: 9px 4.5px;
}
.logo {
font-size: 48px;
font-weight: 900;
color: tomato;
background: white;
padding: 4px 32px;
}
ul {
/* this removes the dots on the list items*/
list-style-type: none;
display: flex;
justify-content: flex-start;
gap: 9px;
}
a {
font-size: 22px;
background: white;
padding: …Run Code Online (Sandbox Code Playgroud)