![](/img/trans.png)
[英]How can I move the 'X' button to the end of the right side(inline with the left side of text)?
[英]How to i move the text to the left side of the container?
我已经尝试在CSS中使用margin 0 auto,但是它似乎没有用,我不太确定自己在做什么错,有人可以帮助我吗? 我想将文本移到容器的左侧,因为到目前为止,它位于容器的中间。 我正在谈论的文本是p标签中的文本,它们是电子邮件,Facebook,instagram和twitter。 感谢您抽出宝贵的时间来帮助您。 祝你有美好的一天!
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Contact</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link href="css/yourCustom.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>
<nav role="navigation" class="navbar navbar-default navbar-static-top">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" data-target="#navbarCollapse" data-toggle="collapse" class="navbar-toggle">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="index.html" class="navbar-brand" style="color:#000000">Paulo Pinzon-Iradian</a>
</div>
<!-- Collection of nav links and other content for toggling -->
<div id="navbarCollapse" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="work.html" style="color:#000000; margin-left:1.5em;">Work</a></li>
<li><a href="about.html" style="color:#000000; margin-left:1.5em;">About</a></li>
<li><a href="contact.html" style="color:#000000; margin-left:1.5em;">Contact</a></li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="jumbotron">
<p style="font-size:24px;"></p>ppinzon-iradian@hotmail.com</p>
</br>
<p><a>Facebook</a></p>
<p><a>Instagram</a></p>
<p><a>Twitter</a></p>
</div>
</div> <!-- /container -->
<div>
</div>
</body>
</html>
CSS:
.navbar-default{
background: #fff;
margin-top:3.5%;
border:0px;
}
.navbar-brand
{
font-family: helvetica;
font-size: 24px;
}
ul, li, a
{
font-family: helvetica;
font-size: 24px;
color: #000000;
letter-spacing: -0.5px;
font-weight: 100;
}
.navbar-toggle
{
border:0px;
}
.col-xs-6
{
margin-top:1.5%;
line-height: 27px;
}
.row
{
width: 92%;
margin-left: auto;
margin-right: auto;
}
.jumbotron
{
background: #fff;
border:0px;
font-family: helvetica;
font-size: 24px;
text-decoration: none;
}
您要删除边距的元素位于.jumbotron
元素内,该元素由引导程序设置样式,并将添加这些边距/填充。 在docs上查看jumbotron
<div class="jumbotron">
您可以通过在样式中添加!important
来覆盖样式(在引导样式之后让我烦恼),也可以使用jumbotron以外的其他引导组件。
如果您的意思是.jumbotron
类中的文本,则只需删除中的padding-left
@media screen and (min-width: 768px) {
.container .jumbotron, .container-fluid .jumbotron {
padding-right: 60px;
padding-left: 0;
}
}
或只是将其删除
@media screen and (min-width: 768px) {
.container .jumbotron, .container-fluid .jumbotron {
padding-right: 60px;
{
}
当前, p
元素周围有很大的填充。 要解决此问题而又不使用bootstrap类覆盖它,请添加新类no-padding
,然后在针对该新类的css上覆盖它。
例如
HTML
<div class="container">
<div class="jumbotron no-padding">
<p style="font-size:24px;"></p>ppinzon-iradian@hotmail.com</p>
</br>
<p><a>Facebook</a></p>
<p><a>Instagram</a></p>
<p><a>Twitter</a></p>
</div>
</div> <!-- /container -->
CSS
.container .jumbotron.no-padding
{
background: #fff;
border:0px;
font-family: helvetica;
font-size: 24px;
text-decoration: none;
padding-left: 0;
padding-right: 0;
}
通过css页面或内联样式,从jumbotron
容器中除去左侧填充物。
例:
<div class="jumbotron" style="padding-left:0px;">
// your content here
</div>
或(使用CSS):
.jumbotron {
padding-left: 0px !important;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.