2012-04-13 2 views
2

У меня есть макет потока со следующими двумя выравнивания выдаетHTML и CSS Layout Flow Выпуск

  1. см Изображение 1: Когда я изменяю зоопарк, информация название совпадает с логотипом.

  2. Refer Image 2: Зеленая коробка должна быть как правая сторона синей коробки; в настоящее время он идет на дно.

Как исправить ошибку? Код доступен в this fiddle. Добавлено также.

Уверен, что это очень простой урок выравнивания; однако я не могу понять это даже после многих часов? Не могли бы вы взглянуть на него и ответить?

Изображение 1 enter image description here

Изображение 2 enter image description here

<!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 id="Head1"> 
<title>Support Site </title> 
<link href="Styles/MasterStyle.css" rel="stylesheet" type="text/css" /> 
</head> 
<body> 
<div id="wrapper"> 
    <div id="container"> 
     <div id="header"> 
      <div id="logo"> 
       <img alt="logo" src="Images/Logo.bmp" /> 
      </div> 
      <div id="titleInfo"> 
       <a href="#">Admin XXXXXXXX Support Site</a> 
       <div id="signOut"> 
        <a id="logOnStatus" class="signOut" > 
         Logout</a> 
       </div> 
      </div> 
      <div class="clear"> 
      </div> 
     </div> 
     <div id="centralContainer"> 
      <div id="leftNavContainer"> 
       <div id="subContainerForLeftNav"> 
        <div id="adminDiv"> 
         <div class="backgroundButton" id="adminButton"> 
          <p class="buttonText"> 
           The Admin</p> 
         </div> 
        </div> 
        <div class="clear"> 
        </div> 
        <div id="vendorDiv"> 
         <div class="menuTextHeading"> 
          <a class="menuText">The Management</a> 
         </div> 
         <div class="buttonAlign"> 
          <div class="backgroundButton" id="connectivityButton"> 
           <p class="buttonText"> 
            Test</p> 
          </div> 
          <div class="backgroundButton" id="vendorsButton"> 
           <p class="buttonText"> 
            Test</p> 
          </div> 
         </div> 
        </div> 
        <div class="clear"> 
        </div> 
        <div id="monitoringDiv"> 
         <div class="menuTextHeading"> 
          <a class="menuText">Test</a> 
         </div> 
         <div class="buttonAlign"> 
          <div class="backgroundButton" id="transactionsButton"> 
           <p class="buttonText"> 
            Test</p> 
          </div> 
          <div class="backgroundButton" id="logsButton"> 
           <p class="buttonText"> 
            Test</p> 
          </div> 
         </div> 
        </div> 
       </div> 
      </div> 
      <div id="mainContainer"> 
       <div id="transactionContentHolder" class="transactionContentHolder"> 
        A 
       </div> 
      </div> 
      <div class="clear"> 
      </div> 
     </div> 
    </div> 
</div> 
</body> 
</html> 

CSS

body 
{ 
    margin: 0px; 
    padding: 0px; 
    text-align: center; 
    background: Yellow; 
} 

#wrapper 
{ 
    width: 100%; 
    height: auto; 
    text-align:left; 
    margin: 0 auto; 
    /*background: #FFBA31;*/ 
    background: #FFBA31; 
} 

#container 
{ 
    width: 100%; 
    height: auto; 
    margin: 0 auto; 
    background: white; 

} 

#header 
{ 
    width: 100%; 
    height: 70px; 
    background: white; 
    padding: 0 0 10px 0; 
    border:1px solid Red; 

} 

#titleInfo 
{ 
font:bold 18pt Arial; 
color:#2377D1; 
width:80%; 
    height:35px; 
    float:right; 
    margin:10px 0 0 10px; 
    border-bottom:3px solid #fcda55; 
    padding: 10px 0 0 0; 
    display:inline; 

} 

#signOut 
{ 
font:bold 9pt Arial; 
    float:right; 
    border-bottom:none; 
    padding: 0px 10px 0 0; 
    margin: 0px 0px 30px 0; 
    display:inline; 
} 



#logo 
{ 
    width:15%; 
    height:60px; 
    float:left; 
    margin:0 0 0 20px; 
    display:inline; 
    padding: 10px 0 30px 0; 
} 

#centralContainer 
{ 
    width: 100%; 
    height:auto; 
    margin: 0 auto; 
    background: white; 
} 

#leftNavContainer 
{ 
    width: 20%; 
    height: 700px; 
    /*float: left;*/ 
    margin: 0 0 0 10px; 
    display: inline; 
    background: white; 
    border:1px solid Blue; 
} 

#subContainerForLeftNav 
{ 
width: 190px; 
height: auto; 

} 

#mainContainer 
{ 
    width: 75%; 
    height: 700px; 
    float: left; 
    margin: 0 0 0 30px; 
    display: inline; 
    background:white; 
    border:1px solid Green; 
} 




.menuText 
{ 
    font:bold 13pt Arial; 
    line-height:15pt; 
    color:#00A6B5; 
} 

.menuTextHeading 
{ 
    height:20px; 
    border-bottom:3px solid #fcda55; 
    padding:10px 0 10px 0; 
    margin:0 0 10px 0; 
} 

.buttonAlign 
{ 
    height:auto; 
    width:auto; 
    float: right; 
    padding:0 0 0 0; 
    margin:0 0 0 0; 
} 


.backgroundButton 
{  
    width:150px; 
    height:86px; 
    display: block; 
    margin: 0px 0px 5px 0px; 
    background-image:url('../Images/ButtonBackground.bmp'); 
} 

.buttonText 
{ 

    font:bold 15pt Arial; 
    line-height:18pt; 
    color:#ffffff; 
    padding:40px 15px 0 15px; 
    margin:0 0 0 0; 
    text-align:center; 

} 

.clear 
{ 
    clear: both; 
} 
+0

вы можете начать с размещения только соответствующего кода. – Joseph

+0

Что это связано с 'asp.net',' javascript' или 'jquery'? Пожалуйста, отметьте ваши вопросы правильно в будущем. –

+0

В основном это говорит: «вот моя проблема, и вот весь мой код ... исправьте!» Просто дайте нам то, что нам нужно отлаживать, а не всю нагрузку. Это не наша работа, чтобы просеивать через парусов кода –

ответ

2

см скрипку для кода и демо

скрипку: http://jsfiddle.net/L3And/3/

демо: http://jsfiddle.net/L3And/3/embedded/result/

Screen Shot:

enter image description here

+0

Спасибо. При увеличении на 155%, заголовок разбивается на две строки. Также зеленые ящики идут вниз. Есть ли способ, при котором регулировка (уменьшение ширины) произойдет только до минимальной ширины, чтобы текст не переходил во вторую строку? Кроме того, можете ли вы объяснить, что такое концепция, которую я пропустил здесь? – Lijo

+0

Для заголовка titleInfo в заголовке i умышленно установленного переполнения: скрытый, который предотвращает разбиение макета. В моей системе зеленый ящик не спускается. Можете ли вы указать мне, почему вы увеличиваете масштаб? Я имею в виду любую конкретную проблему дизайна или что-то еще? – w3uiguru

+0

Вы установили элементы уровня блока в строку, которая меньше используется в вашем случае. Маржа, заполнение, ширина элементов и поплавков используются неправильно, поэтому ваш макет был испорчен. – w3uiguru

1

body { 
 
    margin: 0px; 
 
    padding: 0px; 
 
    text-align: center; 
 
    background: Yellow; 
 
} 
 
#wrapper { 
 
    width: 100%; 
 
    height: auto; 
 
    text-align: left; 
 
    margin: 0 auto; 
 
    /*background: #FFBA31;*/ 
 
    background: #FFBA31; 
 
} 
 
#container { 
 
    width: 100%; 
 
    height: auto; 
 
    margin: 0 auto; 
 
    background: white; 
 
} 
 
#header { 
 
    background: none repeat scroll 0 0 white; 
 
    border: 1px solid Red; 
 
    height: 70px; 
 
    margin-bottom: 20px; 
 
    padding: 0 0 10px; 
 
    width: 100%; 
 
} 
 
#titleInfo { 
 
    border-bottom: 3px solid #FCDA55; 
 
    color: #2377D1; 
 
    float: right; 
 
    font: bold 18pt Arial; 
 
    height: 35px; 
 
    margin: 10px 0 0 10px; 
 
    overflow: hidden; 
 
    padding: 10px 0 0; 
 
    width: 55%; 
 
} 
 
#signOut { 
 
    font: bold 9pt Arial; 
 
    float: right; 
 
    border-bottom: none; 
 
    padding: 0px 10px 0 0; 
 
    margin: 0px 0px 30px 0; 
 
    display: inline; 
 
} 
 
#logo { 
 
    border: 1px solid orange; 
 
    float: left; 
 
    height: 32px; 
 
    margin: 03px 0 0 20px; 
 
    padding: 10px 0 30px; 
 
    width: 15%; 
 
} 
 
#centralContainer { 
 
    width: 100%; 
 
    height: auto; 
 
    margin: 0 auto; 
 
    background: white; 
 
} 
 
/*Elements within centralContainer*/ 
 

 
#leftNavContainer { 
 
    background: none repeat scroll 0 0 #CCCCCC; 
 
    border: 1px solid Blue; 
 
    float: left; 
 
    height: 700px; 
 
    margin: 0 0 0 10px; 
 
    width: 20%; 
 
} 
 
#subContainerForLeftNav { 
 
    width: 190px; 
 
    height: auto; 
 
    /*border:1px solid green;*/ 
 
} 
 
#mainContainer { 
 
    background: none repeat scroll 0 0 white; 
 
    border: 1px solid Green; 
 
    height: 700px; 
 
    margin: 0 0 0 219px; 
 
    width: 76%; 
 
} 
 
.menuText { 
 
    font: bold 13pt Arial; 
 
    line-height: 15pt; 
 
    color: #00A6B5; 
 
} 
 
.menuTextHeading { 
 
    height: 20px; 
 
    border-bottom: 3px solid #fcda55; 
 
    padding: 10px 0 10px 0; 
 
    margin: 0 0 10px 0; 
 
} 
 
.buttonAlign { 
 
    height: auto; 
 
    width: auto; 
 
    float: right; 
 
    padding: 0 0 0 0; 
 
    margin: 0 0 0 0; 
 
} 
 
.backgroundButton { 
 
    width: 150px; 
 
    height: 86px; 
 
    display: block; 
 
    margin: 0px 0px 5px 0px; 
 
    background-image: url('../Images/ButtonBackground.bmp'); 
 
} 
 
.buttonText { 
 
    font: bold 15pt Arial; 
 
    line-height: 18pt; 
 
    color: #ffffff; 
 
    padding: 40px 15px 0 15px; 
 
    margin: 0 0 0 0; 
 
    text-align: center; 
 
} 
 
.clear { 
 
    clear: both; 
 
}
<!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 id="Head1"> 
 
    <title>Support Site</title> 
 
    <link href="Styles/MasterStyle.css" rel="stylesheet" type="text/css" /> 
 
</head> 
 

 
<body> 
 
    <div id="wrapper"> 
 
    <div id="container"> 
 
     <div id="header"> 
 
     <div id="logo"> 
 
      <img alt="logo" src="Images/Logo.bmp" /> 
 
     </div> 
 
     <div id="titleInfo"> 
 
      <a href="#">Admin XXXXXXXX Support Site</a> 
 
      <div id="signOut"> 
 
      <a id="logOnStatus" class="signOut"> 
 
          Logout</a> 
 
      </div> 
 
     </div> 
 
     <div class="clear"> 
 
     </div> 
 
     </div> 
 
     <div id="centralContainer"> 
 
     <div id="leftNavContainer"> 
 
      <div id="subContainerForLeftNav"> 
 
      <div id="adminDiv"> 
 
       <div class="backgroundButton" id="adminButton"> 
 
       <p class="buttonText"> 
 
        The Admin</p> 
 
       </div> 
 
      </div> 
 
      <div class="clear"> 
 
      </div> 
 
      <div id="vendorDiv"> 
 
       <div class="menuTextHeading"> 
 
       <a class="menuText">The Management</a> 
 
       </div> 
 
       <div class="buttonAlign"> 
 
       <div class="backgroundButton" id="connectivityButton"> 
 
        <p class="buttonText"> 
 
        Test</p> 
 
       </div> 
 
       <div class="backgroundButton" id="vendorsButton"> 
 
        <p class="buttonText"> 
 
        Test</p> 
 
       </div> 
 
       </div> 
 
      </div> 
 
      <div class="clear"> 
 
      </div> 
 
      <div id="monitoringDiv"> 
 
       <div class="menuTextHeading"> 
 
       <a class="menuText">Test</a> 
 
       </div> 
 
       <div class="buttonAlign"> 
 
       <div class="backgroundButton" id="transactionsButton"> 
 
        <p class="buttonText"> 
 
        Test</p> 
 
       </div> 
 
       <div class="backgroundButton" id="logsButton"> 
 
        <p class="buttonText"> 
 
        Test</p> 
 
       </div> 
 
       </div> 
 
      </div> 
 
      </div> 
 
     </div> 
 
     <div id="mainContainer"> 
 
      <div id="transactionContentHolder" class="transactionContentHolder"> 
 
      A 
 
      </div> 
 
     </div> 
 
     <div class="clear"> 
 
     </div> 
 
     </div> 
 
    </div> 
 
    </div> 
 
</body> 
 

 
</html>

это может помочь вам fiddle

+2

, пожалуйста, уточните это и включите соответствующие фрагменты кода. хороший ответ должен быть самодостаточным или, по крайней мере, содержать абзац, описывающий абстрактную концепцию. Спасибо. –