Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
356 views
in Technique[技术] by (71.8m points)

html - CSS Box above text also background code please

Ok so here is my code for my < style >. The box that should be outlining isn't working, its just going above.

Also, I would like to know how I can make my background completely black

<div id="header">

    </h1>
    <style>
    #header {text-align:middle}
    .info-container {width: 840px; border: 1px solid #d8d5c6: padding: 4px; margin: 40px auto 0;}

    .inner-border {background-color: #fcfbf9; border: 1px solid #d8d5c6; padding: 10px 20px;}

    .coming-soon-visitor strong, .coming-soon-owner strong {font-weight: bold; color: #000;}

    .coming-soon-owner {float: left; font-size: 14px; color: #6d6a5b; font-weight: normal; width: 400px; border-right: 1px solid #d9d6c5; padding: 10px 0; margin-bottom: 10px;}

    .coming-soon-visitor {float: left; font-size: 14px; color: #6d6a5b; font-weight: normal; padding-left: 20px; padding: 10px 0 10px 20px; margin-bottom: 10px;}

    </style>
    <div class="info-container">
        <div class="inner-border clear-fix">
            <h3 class="coming-soon-owner">
                Coming <strong>soon!</strong>
            </h3>
            <h3 class="coming-soon-visitor">

            Hey! We are programming! <strong>Please </strong>wait!

            </h3>
        </div>
    </div>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

From looking at the code I would say you have a simple case of the floating divs. It's nothing a clearfix can't take care of.

I use the one found here that can be summed up like this.

.group:after {
  content: "";
  display: table;
  clear: both;
}

Add that to your .info-container should fix your issue.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...