我想知道边距属性如何影响我设置为直接显示的元素。
我知道对于内联元素无法使用顶部和底部边距,并且使用此左侧边距,浏览器在顶部而不是左侧进行缩进。底部也有少量边距,但左侧没有。
是否可以向左缩进?
/* 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>
是否甚至可以将nav与display: inline
一起使用?我想将导航仪水平放置在一行上,但可惜没有任何反应,而且这里也没有子弹(也许与边距有些联系)。我该如何解决?
这就是我的代码