1

好的,我上周一直在尝试自己做这件事。我发誓我已经访问了每个可用的 Google 页面。

我最初的问题是我的三列图层是堆叠的。
在这个网站上遇到一个类似的问题后,我能够使用浮动技术让我的页脚分成三列。

但是,它有一个角度:
就像,第一列是我希望所有这些都出现的地方。
我将发布我的 CSS 和 HTML。

我对此很陌生,你们所有人可能都会对我的代码有多糟糕感到恶心。但是,这就是我来找你的原因。我需要帮助,因为我一个人做不到。

你可以在这里查看我正在开发的网站。http://www.bbcardmore.com/

.left{
text-align:left;
float:left;
}
.right{
float:right;
text-align:right;
}
.centered{
text-align:center;
}

<?php?>
<html>
<body>
<head>
</style>
   <head>
    <div id="footer">
     <div class="left">
     <h3><p style="padding-top: 10pt; " class="paragraph_style"><font size="5" color="red">About Us</font><br /></p></h3>
         <p class="paragraph_style_1"><a title="Our History" href="http://www.bbcardmore.com/bbc-history-3/">Our History</a>                 <br /></p>
         <p class="paragraph_style_1"><a title="Our Pastor" href="http://www.bbcardmore.com/our-pastor/">Our Pastor</a><br />  </p>
         <p class="paragraph_style_1"><a title="Statement Of Faith" href="http://www.bbcardmore.com/statement-of- faith/">Statement Of Faith</a><br /></p>
         <p class="paragraph_style_1"><a title="Calendar" href="http://www.bbcardmore.com/calendar/">Calendar</a><br /></p>
         <p style="padding-bottom: 0pt; " class="paragraph_style_1"><a title="Map"  href="http://www.bbcardmore.com/map/">Map</a></p>

     <div class="centered">
     <h3><p style="padding-top: 10pt; " class="paragraph_style"><a title="Service Times" href="http://www.bbcardmore.com/service-times/"><font size="5" color="red">Service Times</font><br /></p></h3>
         <p class="paragraph_style_1"><a title="Service Times" href="http://www.bbcardmore.com/service-times/"> Sunday School~ 10:00</a><br /></p>
         <p class="paragraph_style_1"><a title="Service Times" href="http://www.bbcardmore.com/service-times/"> Sunday Morning Service~ 11:00 AM</a><br /></p>
         <p class="paragraph_style_1"><a title="Service Times" href="http://www.bbcardmore.com/service-times/"> Sunday Evening Service~ 7:00 PM</a><br /></p>
         <p class="paragraph_style_1"><a title="Service Times" href="http://www.bbcardmore.com/service-times/"> Wednesday Evening Bible Study~ 7:00 PM</a><br /></p>
         <p class="paragraph_style_1"><a title="Service Times" href="http://www.bbcardmore.com/service-times/"> Transportation and child care available for all services.</a><br /></p>

       <div class="right">
    <h3><p style="padding-top: 10pt; " class="paragraph_style"><a title="Contact Us" href="http://www.bbcardmore.com/contact-us/"><font size="5" color="red">Contact Us:</font><br /></p></h3>
        <p class="paragraph_style_2"><a title="Map" href="http://www.bbcardmore.com/map/"><font size="3" color="red">Mailing Address:</font><br /></p>
        <p class="paragraph_style_1"><a title="Map" href="http://www.bbcardmore.com/map/">1515 Easley Drive<br /></p>
        <p class="paragraph_style_1"><a title="Map" href="http://www.bbcardmore.com/map/">Ardmore, OK 73401<br /></p>
        <p class="paragraph_style_3"><span class="style"><a title="" href="mailto:bbcardmore@aol.com"><font size="3" color="red">Email:</font></span> bbcardmore@aol.com<br /></p>
        <p class="paragraph_style_3"><span class="style"><a title="Contact Us" href="http://www.bbcardmore.com/contact-us/"><font size="3" color="red">Phone:</font></span> (580) 223-6629<br /></p>

      <div>
     </body>
    </html>
4

4 回答 4

1

我认为您看起来像这个演示: -http: //tinkerbin.com/N87sxG5i

实际上你并没有关闭你的子 div left, Center, Right,所以我关闭了这些子 div,然后我给float:left;了你center div而不是 text-align:center; 根据您的要求,该 div 及其现在可以正常工作....

HTML

<html>
<body>
<head>
</style>
   <head>
    <div id="footer">
     <div class="left">
     <h3><p style="padding-top: 10pt; " class="paragraph_style"><font size="5" color="red">About Us</font><br /></p></h3>
         <p class="paragraph_style_1"><a title="Our History" href="http://www.bbcardmore.com/bbc-history-3/">Our History</a>                 <br /></p>
         <p class="paragraph_style_1"><a title="Our Pastor" href="http://www.bbcardmore.com/our-pastor/">Our Pastor</a><br />  </p>
         <p class="paragraph_style_1"><a title="Statement Of Faith" href="http://www.bbcardmore.com/statement-of- faith/">Statement Of Faith</a><br /></p>
         <p class="paragraph_style_1"><a title="Calendar" href="http://www.bbcardmore.com/calendar/">Calendar</a><br /></p>
         <p style="padding-bottom: 0pt; " class="paragraph_style_1"><a title="Map"  href="http://www.bbcardmore.com/map/">Map</a></p>
            </div>  

     <div class="centered">
     <h3><p style="padding-top: 10pt; " class="paragraph_style"><a title="Service Times" href="http://www.bbcardmore.com/service-times/"><font size="5" color="red">Service Times</font><br /></p></h3>
         <p class="paragraph_style_1"><a title="Service Times" href="http://www.bbcardmore.com/service-times/"> Sunday School~ 10:00</a><br /></p>
         <p class="paragraph_style_1"><a title="Service Times" href="http://www.bbcardmore.com/service-times/"> Sunday Morning Service~ 11:00 AM</a><br /></p>
         <p class="paragraph_style_1"><a title="Service Times" href="http://www.bbcardmore.com/service-times/"> Sunday Evening Service~ 7:00 PM</a><br /></p>
         <p class="paragraph_style_1"><a title="Service Times" href="http://www.bbcardmore.com/service-times/"> Wednesday Evening Bible Study~ 7:00 PM</a><br /></p>
         <p class="paragraph_style_1"><a title="Service Times" href="http://www.bbcardmore.com/service-times/"> Transportation and child care available for all services.</a><br /></p>
                </div>

       <div class="right">
    <h3><p style="padding-top: 10pt; " class="paragraph_style"><a title="Contact Us" href="http://www.bbcardmore.com/contact-us/"><font size="5" color="red">Contact Us:</font><br /></p></h3>
        <p class="paragraph_style_2"><a title="Map" href="http://www.bbcardmore.com/map/"><font size="3" color="red">Mailing Address:</font><br /></p>
        <p class="paragraph_style_1"><a title="Map" href="http://www.bbcardmore.com/map/">1515 Easley Drive<br /></p>
        <p class="paragraph_style_1"><a title="Map" href="http://www.bbcardmore.com/map/">Ardmore, OK 73401<br /></p>
        <p class="paragraph_style_3"><span class="style"><a title="" href="mailto:bbcardmore@aol.com"><font size="3" color="red">Email:</font></span> bbcardmore@aol.com<br /></p>
        <p class="paragraph_style_3"><span class="style"><a title="Contact Us" href="http://www.bbcardmore.com/contact-us/"><font size="3" color="red">Phone:</font></span> (580) 223-6629<br /></p>
            </div>

      <div>
     </body>
    </html>

CSS

.left{
text-align:left;
float:left;
}
.right{
float:right;
text-align:right;
}
.centered{
float:left;
margin-left:25px;
}
于 2012-07-04T05:07:04.467 回答
1

我不确定,但它可能会工作......试试这个代码..

.left{
float:left;
}
.right{
float:left;
}
.centered{
float:left;
}
于 2012-07-04T05:08:41.147 回答
0

您需要正确格式化标签,关闭所有打开的标签以避免嵌套错误。

浮动是一项棘手的工作,浮动元素需要放置在要围绕它们流动的元素之前。

您的标记应采用如下格式:

<div class="center">
    <div class="left">
        <p class="red-title">About Us</p>
        <p><a title="Our History" href="http://www.bbcardmore.com/bbc-history-3/">Our History</a></p>
        <p><a title="Our Pastor" href="http://www.bbcardmore.com/our-pastor/">Our Pastor</a></p>
        <p><a title="Statement Of Faith" href="http://www.bbcardmore.com/statement-of- faith/">Statement Of Faith</a></p>
        <p><a title="Calendar" href="http://www.bbcardmore.com/calendar/">Calendar</a></p>
        <p><a title="Map"  href="http://www.bbcardmore.com/map/">Map</a></p>
    </div>
    <div class="right">
        <p class="red-title"><a title="Contact Us" href="http://www.bbcardmore.com/contact-us/">Contact Us:</a></p>
        <p><a title="Map" href="http://www.bbcardmore.com/map/"><span class="red">Mailing Address:</span></a></p>
        <p><a title="Map" href="http://www.bbcardmore.com/map/">1515 Easley Drive</a></p>
        <p><a title="Map" href="http://www.bbcardmore.com/map/">Ardmore, OK 73401</a></p>
        <p><a title="Email" href="mailto:bbcardmore@aol.com"><span class="red">Email:</span> bbcardmore@aol.com</a></p>
        <p><a title="Contact Us" href="http://www.bbcardmore.com/contact-us/"><span class="red">Phone:</span> (580) 223-6629</a></p>
    </div>
    <p class="red-title"><a title="Service Times" href="http://www.bbcardmore.com/service-times/">Service Times</a></p>
    <p><a title="Service Times" href="http://www.bbcardmore.com/service-times/">Sunday School~ 10:00</a></p>
    <p><a title="Service Times" href="http://www.bbcardmore.com/service-times/">Sunday Morning Service~ 11:00 AM</a></p>
    <p><a title="Service Times" href="http://www.bbcardmore.com/service-times/">Sunday Evening Service~ 7:00 PM</a></p>
    <p><a title="Service Times" href="http://www.bbcardmore.com/service-times/">Wednesday Evening Bible Study~ 7:00 PM</a></p>
    <p><a title="Service Times" href="http://www.bbcardmore.com/service-times/">Transportation and child care available for all services.</a></p>
</div>

这个 CSS 表会将此标记转换为您所追求的三列设计:

.left {
    float: left;
    text-align: left;
}
.right {
    float: right;
    text-align: right;
}
.center {
    text-align: center;
}
.red-title {
    color: #e00;
    font-size: 180%;
    font-family: sans-serif;
}
.red {
    color: #e00;
}
a {
    color: inherit;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
p {
    margin: 8px;
}
于 2012-07-04T05:01:37.353 回答
0

我想这就是你要找的

     <div style="background-color: Black; width: 100%; height: 680px;">
            <div style="width: 970px; margin: 0 auto;padding:0px">
                <div style="width: 25%; height: 675px; float: left; background-color: Blue;">
                 Left div
                </div>
                <div style="width: 75%; height: 675px; float: right; background-color: white">
                    <div style="width: 75%; height: 675px; float: left; background-color: red">
                    Center Div
                    </div>
                    <div style="width: 25%; height: 675px; float: right; background-color: Green">
                     Right Div
                    </div>
                </div>
            </div>
        </div>
于 2012-07-04T05:02:52.883 回答