1

我使用 Dreamweaver 和表格制作了这个网站 ( http://aghicks.co.uk/ ),现在我正在学习 Bootstrap。我有一些事情我无法完全解决。

到目前为止我有这个

<!DOCTYPE html>
<html lang="en">
<head>

    <link href="css/bootstrap.css" rel="stylesheet" type="text/css">
    <link href="css/stylesheet.css" rel"stylesheet" type="text/css">
    <style type="text/css">
    body {
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        max-width: 1000px;
        border: 1px solid black;
        background:#EAEAEA;
        margin: auto;
        padding-top: 66px;
    }

    .redtext {
        color: #b83535;
    }

    a {
        color: #333;
    }

    a:hover {
        color: #b83535;
        text-decoration: none;
    }

    .align_right {
        text-align: right;
    }

    .logo {
        min-width: 286px;
    }

    span {
        font-weight: 300;
    }

    .navbar {
        padding-top: 34px;
    }

    .centered {
        float: none !important;
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: center !important;
    }

    h4 {
        font-size: 16px;
    }

    /* Homepage */

    /* Footer */

    .footer_wrapper {
        max-height: 70px;
    }

    .footer {
        background-color: #999999;
    }

    .footer_text {
        color: #FFF;
        font-size: 10px;
        padding-top: 8px;
        padding-left: 8px;
        padding-right: 8px;
    }
</style>
    <link href="css/bootstrap-responsive.css" rel="stylesheet" type="text/css">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AGHicks Homepage</title>
</head>
<body>

<div class="container-fluid">

<!-- Header -->
    <div class="row-fluid">
        <div class="span5 logo">
            <img src="images/Logo.png" class="logo">
        </div>
        <div class="span4 offset3">
                    <img src="images/Phone_icon.png" class="pull-left">
                    <h4 class="pull-right align_right">Northampton <span>01604786464</span><br><br>Mobile <span>07710537685</span></h4>
        </div>
    </div>

    <!-- Navbar -->
    <div class="navbar">
            <div class="navbar-inner">
                <div class="container">
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </a>
                    <div class="nav-collapse collapse">
                        <ul class="nav">
                            <li><a href="http://www.google.com">Home</a></li>
                            <li><a href="http://www.google.com">Gallery</a></li>
                            <li><a href="http://www.google.com">About Us</a></li>
                            <li><a href="http://www.google.com">Contact</a></li>
                        </ul>
                    </div>
                </div>
            </div>
    </div>

    <!-- Content -->
    <div class="row-fluid">
        <div class="span6">
            <img src="images/Homepage/Small_one_off_jobs.png" >
        </div>
        <div class="span6">
            <div class="row-fluid">
                <div class="span12">
                    <h5>Welcome to AGHicks Building Services website! We are a Northampton based, family run company with over 20 years experience. Hardwork, efficiency and reliability are instilled throughout the workforce and we have gained a strong reputation through word of mouth.</h5>
                </div>
            </div>
            <div class"row-fluid">
                <div class="span12">
                    <img src="images/Homepage/Map_pin.png" >
                    <h5 class="redtext">Northampton Based</h5>
                    <img src="images/Homepage/Quote.png" >
                    <h5 class="redtext">Free Quotes</h5>
                    <img src="images/Homepage/Tools.png" >
                    <h5 class="redtext">No Job Too Small</h5>
                    <img src="images/Homepage/Piggybank.png" >
                    <h5 class="redtext">Competitive Prices</h5>
                </div>
            </div>
            <div class="row-fluid">
                <div class="span12">
                    <h5 class="redtext centered">OUR SERVICES INCLUDE</h5>
                </div>
            </div>
            <div class="row-fluid">
                <div class="span5">
            <ul>
                <li><strong>Conservatories</strong></li>
                <li><strong>Extensions</strong></li>
                <li><strong>Window & Door Refits</strong></li>
                <li><strong>Bricklaying</strong></li>
                <li><strong>Driveways</strong></li>
                <li><strong>Carpentry</strong></li>
                <li><strong>Patios</strong></li>
                <li><strong>Stonework</strong></li>
            </ul>
            </div>
            <div class="span6 offset1">
            <ul>
                <li><strong>Plastering</strong></li>
                <li><strong>Kitchen & Bathroom Refits</strong></li>
                <li><strong>Tiling</strong></li>
                <li><strong>Fencing</strong></li>
                <li><strong>Fascias</strong></li>
                <li><strong>Garages & Carports</strong></li>
                <li><strong>Guttering</strong></li>
            </ul>
            </div>

        </div> 
   </div>

   <!-- Footer -->
   <div class="row-fluid footer_wrapper">
        <div class="span12">
            <div class="row-fluid footer">
            <div class="span5">
                <p class="footer_text"><strong>Copyright © AGHicks Building Services 2012 - All rights reserved.<br>Registered Address - 19 Bentley Close, Rectory Farm, Northampton, NN3 5JS.</strong></p>
            </div>
            <div class="span4 offset3 align_right">
                <p class="footer_text"><strong>Web Design Services and SEO from <a href="http://www.benmil.tumblr.com/me">Ben Mildren</a></strong></p>
            </div>
            </div>
        </div>

   </div>     
</div>
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script src="js/bootstrap.min.js"></script>
</body>
</html>

在这些图片中可以看到我遇到的问题http://imgur.com/jdSAKEk,CbbVrv7#0

(body 周围的边框将被移除,navbar 的样式将被更改)

在第一张图片(桌面大小)中,您会看到电话号码图标未与实际号码对齐,并且图标和文本均未与徽标底部对齐。我可以通过使用填充来实现这一点,但是当您减小浏览器的宽度时,填充仍然存在并导致页面中出现巨大的间隙。

第一张图片中的第二个问题是,我无法让中间右侧区域的那些图标和红色文本出现在 www.aghicks.co.uk 目前的“网格”形式中。

最后,在第二张图片上,当浏览器宽度减小时,当空间明显足够时,两个向下的列表彼此对齐。

对于任何问题的任何帮助将不胜感激。

4

1 回答 1

0
  • 你想如何对齐你巨大的电话图标和两行文字和数字?首先在台式机上,然后在平板电脑上?
  • 垂直对齐是一项工作display: table-something; vertical-align: bottom;
  • 网格形成:我会列出 4 个项目,项目将是固定宽度(50% 或 49%),显示为inline-block(或浮动到.clearfix容器中)。
  • 第二张图片和列表不是并排的:嗯,在这个宽度上应用了哪些 CSS?将规则检查到相关媒体查询中。也许它们显示为宽度为 50% 的内联块?然后仍然有大约的空白。4像素。45% 的宽度会自动解决问题(不要忘记添加 .clearfix 容器,否则内容会溢出到剩余的(10%-4px)剩余空间...)
于 2013-01-28T22:40:43.473 回答