相关疑难解决方法(0)

使用CSS删除ul缩进

当我的列表中的长行环绕时,我似乎无法从我的无序列表中删除缩进.这是我的列表的样子:

  • Windows用户可以使用putty
  • Mac用户可以使用Terminal.app
  • Linux用户可以使用SSH userid@ourserver.com端口22
  • ...........>或者使用像Cyber​​duck这样的SFTP程序,只需将其指向........................... ..............> ourserver.com,22号港口

(点显示缩进)

我已经阅读了一堆解决方案,尝试使用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)

html css html-lists

138
推荐指数
3
解决办法
27万
查看次数

将&lt;li&gt;元素居中而不考虑要点

我不确定如何将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 css css3 centering

11
推荐指数
1
解决办法
384
查看次数

删除列表项和导航顶部之间的间隙

大家好,这里是初级开发人员,我的网页遇到很多问题。

但主要的一个是我的导航链接和导航栏顶部之间的间隙。

我尝试了很多解决方案,但似乎没有一个有帮助。即使对于网站中的其他问题,我真的很感激任何帮助。请记住,该网站还远未完成,我是初学者。谢谢。

在此输入图像描述

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)

html css

1
推荐指数
1
解决办法
474
查看次数

我的左侧标题的 div 中有多余的空间?

我正在尝试完成 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)

html css flexbox

0
推荐指数
1
解决办法
162
查看次数

标签 统计

css ×4

html ×4

centering ×1

css3 ×1

flexbox ×1

html-lists ×1