douwen5584 2015-04-03 12:24
浏览 35

将表单集中在旋转木马引导程序php中

I have a working carousel that contains a form and 3 images, I would like the carousel to be larger than it is (I thought if i didnt define the height and width it would be the size of the images but this hasnt worked), I want the form to appear in the center of the carousel, at the minute it is on the left, even though i have float:center i also experimented with padding but nothing seems to work. I have attached my code below, can anyone give me advice on 1) how to position the form to where i want within the carousel 2) how to make the carousel be the size of the images or larger than it is at the minute. Any help would be much appreciated...

<style>
  .carousel-inner > .item > img,
  .carousel-inner > .item > a > img {
  margin: auto;
}

</style>
</head> 
<body>


<br>
<div id="myCarousel" class="carousel slide" data-ride="carousel"   >
 <!-- Indicators -->
<ol class="carousel-indicators">
  <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
  <li data-target="#myCarousel" data-slide-to="1"></li>
  <li data-target="#myCarousel" data-slide-to="2"></li>
  <li data-target="#myCarousel" data-slide-to="3"></li>
</ol>

<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
  <div class="item active">
        <div class="span8" style="float:center; margin:0px, 0px, 0px, 20px;">
<form role="form" name="login" action="login.php" method="POST" style="align-center" >
Username<br><input type="text" name="Username" /></br>
Password<br><input type="password" name="Password" /></br>
<br><input type="submit" value="Login" name="login" />
<br>
<br>
<br>
</form>
</div>
  </div>

  <div class="item">
    <img src="UUJ.jpg" alt="UUJ">
  </div>

  <div class="item">
    <img src="UU2.jpg" alt="UU2">
  </div>

  <div class="item">
    <img src="UU3.jpg" alt="UU3">
  </div>
</div>

<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
  <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
  <span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
  <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
  <span class="sr-only">Next</span>
</a>

  • 写回答

1条回答 默认 最新

  • douying3251 2015-04-03 12:50
    关注

    To center the form you have to set width with margin-left: auto and margin-right: auto

    <div class="span8" style="width: 500px; margin-right: auto; margin-left: auto;">
      <!-- your form goes here -->
    </div>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥20 为什么我写出来的绘图程序是这样的,有没有lao哥改一下
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥200 关于#c++#的问题,请各位专家解答!网站的邀请码
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号