Html 文本对齐不正确居中
所以。。。我在div中有一个图像,然后将其设置为text/align,但它不是100%居中。。。导航也一样。。。很接近,但并不完美。。。其他一切都很好。谁能帮我一下,因为我快疯了。提前感谢您所有的帮助 HTMLHtml 文本对齐不正确居中,html,css,image,nav,centering,Html,Css,Image,Nav,Centering,所以。。。我在div中有一个图像,然后将其设置为text/align,但它不是100%居中。。。导航也一样。。。很接近,但并不完美。。。其他一切都很好。谁能帮我一下,因为我快疯了。提前感谢您所有的帮助 HTML 通过使用这个jsfiddlehttps://jsfiddle.net/hayrugh0/ 检查页面时,会发现ul元素导致的左侧填充,这是浏览器的默认填充 附加这个css规则,它应该居中 ul { padding: 0; } 希望这是有意义的您所有的图像都包含在div标签中,因此您可
通过使用这个jsfiddle
https://jsfiddle.net/hayrugh0/
检查页面时,会发现ul元素导致的左侧填充,这是浏览器的默认填充
附加这个css规则,它应该居中
ul {
padding: 0;
}
希望这是有意义的您所有的图像都包含在div标签中,因此您可以定义要居中的图像。谢谢这是div和nav中的徽标,但是nav确实关闭了为什么您有几个
头部
和身体
标签?和head
标签在未关闭的body
标签内。只有导航。。。当我放置ul{padding:0,}时,它在DreaWaver中看起来还可以,但在浏览器中它仍然看起来没有定心Hello!我不知道你正在使用的浏览器,但在我的浏览器中导航是居中的。
@charset "utf-8";
.logo {
padding-bottom: 0.5%;
text-align: center;
}
nav {
font-family: "Proxima";
text-align: center;
font-size: 25px;
word-spacing: 80px;
padding-right: 50px;
padding-bottom: 1%;
padding-left: 50px;
color: #000000;
}
li {
display: inline;
color: #000000;
}
a {
text-decoration: none;
color: black;
}
a:hover {
color: lightgray;
}
a:active {
color: black;
}
body {
background-color: #F6F6F6;
}
table {
margin-left: auto;
margin-right: auto;
}
.raste img {
height: 190px;
width: 300px;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
-ms-transition: all 0.5s ease;
transition: all 0.5s ease;
display: block;
border: none;
}
.raste img:hover {
-webkit-transform: scale(1.079);
transform: scale(1.079);
}
.table {
display: table;
margin: 1em auto;
}
.row {
display: table-row;
}
.raste {
display: table-cell;
}
@font-face {
font-family: Proxima;
src: url(Fonts/Proxima_Regular.otf);
}
ul {
padding: 0;
}