html - 左边距让我缩进错误
问题描述
我想知道边距属性如何影响我设置为内联显示的元素。
我知道对于内联元素是不可能使用上边距和下边距的,并且有了这个左边距,浏览器会在顶部而不是向左缩进。小边距也在底部,但不在左侧。
是否可以向左缩进?
/* Reset CSS template , maybe can be here some connection with my problem too */
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
display: block;
}
body {
line-height: 1;
}
ol,ul {
list-style: none;
}
blockquote,q {
quotes: none;
}
blockquote:before,blockquote:after,q:before,q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
/* Here I´m including my CSS file */
/* My CSS file */
nav {
margin-right: 10px;
display: inline;
}
<p> Autorem článku je Aleš Fišer,kontaktovat ho můžete na této <a href="#adresa">adrese</a></p>
<nav>
<header role="banner" id="zahlavi">
<nav role="navigation">
<ul id="navigácia">
<li>České Budějovice</li>
<!-- Here starts my nav -->
<li>Telč</li>
<li>Moravské Budějovice</li>
</ul>
</nav>
<h1>Návštěvníci se pomalu chystají na začátek sezóny</h1>
甚至可以使用 navdisplay: inline
吗?我想让我的导航水平,在一排,但遗憾的是什么也没发生,我也没有子弹(可能与边距有关)。我该如何解决?
这就是我的代码
解决方案
推荐阅读
- r - 并排条形图中的颜色问题
- python - 有没有办法让降维参数取决于 sklearn 管道中的上一步?
- python - 如何通过一次来计算给定列表的 N 对?
- android-studio - Android Studio64 没有启动
- c# - 如何在asp.net mvc中通过多个不同的名称调用控制器的方法?
- c# - 通过多个代理将变量从一个 Visual Studio 测试任务传递到 Azure 管道中的另一个
- python - ModuleNotFoundError:没有名为“tensorflow.python.platform”的模块导入错误
- python - 将复杂的评估置于循环条件下是否效率低下?
- java - 字符串中整数的总和
- c# - 函数或变量是否可以存储在命名空间而不是类中 - C#