2014-01-17 3 views
0

두 번째 다른 div (예 : 3 열) 뒤에 내 꼬리말 오른쪽에 div를 띄우려 고 가로로 정렬하고 싶지만 오른쪽으로 떠 다니는 것은 놓기를 유지합니다. 왼쪽의 2 개 아래로 내립니다. 아무도 이것으로 도울 수 있습니까? 여기에 코드입니다바닥 글에 바닥 글이있는 꼬리말

...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
<title>K Blondel Design :: Carpentry &amp; Funiture Design :: Brighton</title> 
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> 
<link href="oneColFixCtr.css" rel="stylesheet" type="text/css" /> 
<link href='http://fonts.googleapis.com/css?family=Abel|Cutive+Mono|Nothing+You+Could+Do' rel='stylesheet' type='text/css'> 
</head> 

<body> 

<div class="container"> 
<div class="subcontainer"> 


<div class="header"> 

<div id="mainNav"> 

    <ul id="mainNav"> 
    <li><a href="#" id="homelink" target="_self">Home</a></li> 
    <li><a href="#" id="aboutuslink" target="_self">About Us</a></li> 
    <li><a href="#" id="ourworklink" target="_self">Our Work </a></li> 
    <li><a href="#" id="contactuslink" target="_self">Contact Us </a></li> 
    </ul> 
</div> 
<div class="contact"> 
E : click here 
    <br /> 
    T : 07585 607521 
</div> 
</div> 


<div class="lineborder"> 
</div> 

     <div class="sidebar-logo"><img src="Images/k-blondel-design-logo.png" width="64" height="108" alt="K Blondel Design logo" /> 
    </div> 

     <div id="contentright"> 

     <div class="galleryimg"><div class="photo"><img src="Images/winebar-furniture-01.jpg" width="145" height="200" alt="Winchester winebar" /></div></div> 

     <div class="galleryimg"><div class="photo"><img src="Images/wooden-outdoor-seating.jpg" width="145" height="200" alt="Winchester winebar" /></div></div> 

     <div class="galleryimg"><div class="photo"><img src="Images/wooden-shelving.jpg" width="145" height="200" alt="Winchester winebar" /></div></div> 

     <div class="galleryimg"><div class="photo"><img src="Images/wooden-winerack.jpg" width="145" height="200" alt="Winchester winebar" /></div></div> 


     </div> 


    <div id="content"> 
    <h1>Instructions </h1> 
    <p>At K Blondel Design we aim to fill the gap between the over exuberant furniture maker and the general carpenter. Trained in the art of creating affordable and elegant solutions to 3D problems.</p> 
    <p>As a small business we are able to deliver a personal one to one design service, talking through various design and material possibilities and arriving at an affordable, bespoke and stylish solution.</p> 
    <p>From design through to construction and installation we specialise in storage solutions, furniture and interiors for both the domestic and commercial markets. </p> 
    <p>Based in Brighton we have 20 years' design and commercial experience and an ever-growing client list spanning Sussex, Hampshire, London and Kent.</p> 

    <p> 
     <!-- end .content --></p> 
    </div> 


    <div class="lineborder"></div> 

    <div id="footer"> 


    <div class="footercolleft"> 
     <a href="#">Carpentry</a><br/> 
     <a href="#">Furniture Design</a><br/> 
     <a href="#">Interior Design &amp; Decoration</a> 
</div> 
    <div class="footercolright"> 
     <a href="#">Storage Solutions</a><br/> 
     <a href="#">Decking &amp; Wooden Flooring</a><br/> 
     <a href="#">Shop Fitting/Commercial Interiors</a> 
</div> 

    <div class="footercoladdress"> 
     Copyright © 2014 Kevin Blondel Design<br />1 Park Terrace, Brighton BN1 0GT 
</div> 
</div> 
    <!-- end .subcontainer --></div> 



    <!-- end .container --></div> 
</body> 
</html> 

여기에 CSS입니다 ...

@charset "UTF-8"; 

body { 
    font: 100%/1.4; 
    background-color:#FFF; 
    margin: 0; 
    padding: 0; 
    color: #000; 
} 

/* ~~ Element/tag selectors ~~ */ 
ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */ 
    padding: 0; 
    margin: 0; 
} 
h1, h2, h3, h4, h5, h6, p { 
    margin-top: 0; /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */ 
    padding-right: 10px; 
    padding-left: 40px; /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */ 
} 

h1 { 
    font-family: 'Abel', Arial, sans-serif; 
    font-size:24px; 
    font-weight: normal;  
} 

h2 { 
    font-family: 'Abel', Arial, sans-serif; 
    font-size:18px; 
} 

p { 
    font-family: 'Cutive Mono', Georgia, serif; 
    font-size:13px; 
    line-height:1.4em; 
    font-weight:600; 

} 

#home #homelink, 
#aboutus #aboutuslink, 
#ourwork #ourworklink, 
#contactus #contactuslink { 
    font-family: 'Abel', Arial, sans-serif; 
    color: #494949; 
    font-size:17px; 
    text-decoration:none; 
    border-bottom: solid 6px #494949; 
} 

#mainNav { 
    margin: 0; 
    padding: 0; 
    list-style: none; 
} 

#mainNav li { 
    float: left; 
    padding: 50px 14px 0 14px; 
} 

#mainNav a { 
    font-family: 'Abel', Arial, sans-serif; 
    color: #494949; 
    font-size:17px; 
    text-decoration:none; 
    padding: 0 20px 0 20px; 
} 

#mainNav a:hover { 
    color:#FFF; 
    background-color: #494949; 
} 

img { 
    border: none; 
} 

a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */ 
    border: none; 
} 
/* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */ 
a:link { 
    color: #494949; 
    text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */ 
} 
a:visited { 
    color: #494949; 
    text-decoration: underline; 
} 
a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */ 
    text-decoration: none; 
} 

/* ~~ this fixed width container surrounds all other elements ~~ */ 
.container { 
    width: 1352px; 
    background-image:url(Images/sktchbook-bgd.jpg); 
    background-repeat:no-repeat; 
    margin: 0 auto; /* the auto value on the sides, coupled with the width, centers the layout */ 
} 

.header { 
    width: 950px; 
    height: 72px; 
    margin-left:90px; 
    margin-right: 90px; 
} 

.header img{ 
    border:none; 
} 

.lineborder { 
    width: 950px; 
    background-color:#494949; 
    height: 1px; 
    margin-left:110px; 
    margin-right:110px; 
} 

.contact { 
    float: right; 
    padding: 27px 0 0 0; 
    font-family: 'Abel', Arial, sans-serif; 
    color: #494949; 
    font-size:17px; 
} 

.sidebar-logo { 
    float: left; 
    width: 70px; 
} 

.subcontainer { 
    width: 1150px; 
    min-height: 880px; 
    margin: 0 auto; 
/* the auto value on the sides, coupled with the width, centers the layout */ 
} 

/* ~~ This is the layout information. ~~ 

1) Padding is only placed on the top and/or bottom of the div. The elements within this div have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the div itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design. 

*/ 
#content { 

    padding: 40px 0; 
    width: 420px; 
    margin-left:90px; 
    margin-right:90px; 
    min-height:475px; 
} 

#contentright { 
    float: right; 
    padding: 40px 0; 
    width: 420px; 
    margin-right:90px; 

} 

.galleryimg { 
    display: inline-block; 
    vertical-align: top; 
    margin: 0 40px 30px 0; 
} 

.photo { 
    -moz-box-shadow: 2px 2px 2px 0px #888; 
-webkit-box-shadow: 2px 2px 2px 0px #888; 
box-shadow: 2px 2px 2px 0px #888; 
} 

.photo img { 
    border: 10px solid #fff; 
    background-color: #fff; 
    position: relative; 
} 

/* ~~ miscellaneous float/clear classes ~~ */ 
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */ 
    float: right; 
    margin-left: 8px; 
} 
.fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */ 
    float: left; 
    margin-right: 8px; 
} 
.clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the overflow:hidden on the .container is removed */ 
    clear:both; 
    height:0; 
    font-size: 1px; 
    line-height: 0px; 
} 

#footer { 
    padding: 10px 0 0 20px; 
    width: 950px; 
    height: 150px; 
    margin-left:90px; 
    margin-right: 90px; 
    font-family: 'Abel', Arial, sans-serif; 
    color: #494949; 
    font-size:14px; 
    line-height: 1.5em; 
} 

#footer a { 
    text-decoration:none; 
    padding: 0 5px 0 5px; 
} 

#footer a:hover { 
    color:#FFF; 
    background-color: #494949; 
} 

.footercolleft { 
    padding: 0; 
    margin: 0; 
    float: left; 
    width: 200px; 
    overflow:hidden; 
} 

.footercolright { 
    padding: 0; 
    width: 200px; 
    overflow:hidden; 
} 

.footercoladdress { 
    float:right; 
    padding: 0 5px 0 5px; 
    text-align: right; 
    width:250px; 
} 

많은 감사합니다!

+0

플로팅 요소가 비 플로팅 요소 뒤에있는 경우 먼저 줄 바꿈을 수행합니다. 즉 줄 바꿈을하는 이유입니다. 먼저 그것을 놓고 그것이 어떻게 행동하는지 보거나 그것을 colright로 바꾸십시오. –

답변

0

두 개의 항목을 오른쪽으로 뜨면 처음에 오는 항목이 실제로 맨 오른쪽으로 이동합니다. 그리고 '중간'열을 떠 다니지 않으므로 주소 열을 아래로 밀어주는 여백이 오른쪽에 있습니다. 위의 의견

<div id="footer"> 
    <div class="footercolleft"> 
     <a href="#">Carpentry</a><br/> 
     <a href="#">Furniture Design</a><br/> 
     <a href="#">Interior Design &amp; Decoration</a> 
    </div> 
    <div class="footercoladdress"> 
     Copyright © 2014 Kevin Blondel Design<br />1 Park Terrace, Brighton BN1 0GT 
    </div> 
    <div class="footercolright"> 
     <a href="#">Storage Solutions</a><br/> 
     <a href="#">Decking &amp; Wooden Flooring</a><br/> 
     <a href="#">Shop Fitting/Commercial Interiors</a> 
    </div> 
</div> 
+0

감사합니다! '오버 플로우 : 숨김'을 추가하면 제대로 작동합니다. #footer css. 지금은 결론과 하단 내용 사이에 큰 차이가 있습니다. 그 일이 어떻게 일어 났는지 확신 할 수 없습니까? –

+0

#footer { \t 패딩 : 0 0 0 20px; \t 너비 : 950px; \t 높이 : 150px; \t margin-left : 90px; \t margin-right : 90px; \t font-family : 'Abel', Arial, sans-serif; \t 색상 : # 494949; \t font-size : 14px; \t 선 높이 : 1.5em; \t 오버플로 : 숨김; } #footer a { \t 텍스트 장식 : 없음; \t 패딩 : 0 5px 0 5px; } #footer a : hover { \t color : #FFF; \t background-color : # 494949; } footercolleft { \t 패딩 : 0; \t 여백 : 0; \t float : left; \t 너비 : 200px; \t 오버플로 : 숨김; } . footercolright { \t 패딩 : 0; \t 너비 : 200px; \t 오버플로 : 숨김; } .footercoladdress { \t float : right; \t 패딩 : 0 5px 0 5px; \t 텍스트 정렬 : 오른쪽; \t 너비 : 250px; } –

+0

처음에는 바닥 글에 10px의 위쪽 패딩이 있지만, 어떤 방법으로 돌아가는 것처럼 보입니다. 상단 패딩 0을 만들었지 만 여전히 기대했던 것보다 큰 차이가 있습니다. –

0

감사 :

DEMO

스위치를 HTML의 순서

. 위에서 설명한대로 html을 다시 정렬하여 오른쪽 부동 div가 두 개의 왼쪽 열 사이에 오도록 수정되었습니다. #footer 속성에 또 하나의 'overflow : hidden'을 추가했습니다.

관련 문제