<分区>
我刚开始学习 CSS,并在我的本地门户网站上创建了一个示例页面。我想知道这些编码风格是否正确。
我开始知道这些编码风格在很大程度上不起作用。
您能否根据我的代码更正我的代码使其更加可行,我会尝试学习您的一些编码风格并根据我的需要进行调整。
很抱歉,如果此类问题无法在此站点中提出。
<div class="initial">
<div style="position:relative; width:100%; margin-Top: 4.75%; font-size: 1.3em; font-family: Helvetica; text-align: center; background-color: #bbb;">
<center><p style='line-height:200%'>
<a href=h.php style="text-decoration: none; color:white"> Home</a>
<a href=click.php style="text-decoration: none; color:white">Please Click Here</a>
<a href=contact.php style="text-decoration: none; color:white">Contact</a>
<a href=about.php style="text-decoration: none; color:white">About Me</a></p></center>
</style>
</div>
</div>
谢谢,
最佳答案
首先要注意的几点..
,而是使用 margin
或 padding
查看我如何实现 padding
.initial-content {
position: relative;
width: 100%;
margin-Top: 4.75%;
font-size: 1.3em;
font-family: Helvetica;
text-align: center;
background-color: #bbb;
}
p {
line-height: 200%;
}
a {
text-decoration: none;
color: white;
padding: 5px 25px;
}
<div class="initial">
<div class="initial-content">
<center>
<p>
<a href=h.php> Home</a>
<a href=click.php>Please Click Here</a>
<a href=contact.php>Contact</a>
<a href=about.php>About Me</a>
</p>
</center>
</div>
</div>
关于html - 这些编码风格是否正确?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32780895/