Jump to content
  • 0

Див посередине сливается с левым дивом


sv12
 Share

Question

9 answers to this question

Recommended Posts

  • 0

Сылки к сожалению нет, так как проект учебный, мне дали его в фирме своей же, как задание, но код есть!

CSS:

body, hrml {

padding: 0px ;

margin: 0px auto ;

text-align: center ;

}

#alldiv {

width: 1000px ;

min-height: 800px ;

border: 1px black solid ;

border-left: 1px #dbdbdb solid ;

border-right: 1px #dbdbdb solid ;

border-top: 0 ;

border-bottom: 0 ;

margin: 0px auto ;

}

#headdiv {

background: url(img/01_01.gif) no-repeat;

width: 1000px ;

height: 164px ;

}

#mdiv {

float: left ;

width: 195px ;

border: 2px solid black ;

font-size: 10pt;

font-family:Verdana, Geneva, sans-serif;

font-weight: bold ;

}

#mdiv a {

color: #717171 ;

padding-top: 10px ;

padding-bottom: 8px ;

text-align: right;

display: block ;

padding-right: 30px ;

text-decoration: none ;

}

#mdiv a:hover {

background: #ff9b00 ;

color: #ffffff ;

}

#mdiv a:visited {

color: #ff5a00 ;

}

#rdiv {

float: right ;

width: 200px ;

text-align: center ;

border: 2px solid black ;

}

#rdiv a img {

margin-bottom:30px;

border: none;

}

#content {

border: 2px solid black ;

}

#ndiv p {

font-size: 11pt ;

font-family: verdana ;

font-weight: bold ;

color: #4a4a4a ;

float: left ;

}

#babyphoto {

background: url(img/01_07.gif)no-repeat ;

}

HTML:

<!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=windows-1251" />

<link href="style.css" rel="stylesheet" type="text/css">

<title>demo</title>

</head>

<body>

</body>

<div id="alldiv">

<div id="headdiv"> </div>

<div id="mdiv">

<a href="#"> главная </a>

<a href="#"> мы и о нас </a>

<a href="#"> новости </a>

<a href="#"> архив данных </a>

<a href="#"> прайс </a>

<a href="#"> наши клиенты </a>

<a href="#"> акции </a>

<a href="#"> контакты </a>

</div>

<div id="rdiv">

<a href="#"><img src="img/01_04.gif" /></a>

<a href="#"><img src="img/01_10.gif" /></a>

<a href="#"><img src="img/01_12.gif" /></a>

<a href="#"><img src="img/01_15.gif" /></a>

</div>

<div id="content"> <div id="ndiv"><p>Название страницы</p></div>

<div id="babyphoto"> </div>

</div>

</div>

</html>

Edited by sv12
Link to comment
Share on other sites

  • 0

если я правильно понял, должен получиться один из двух вариантов:

1. var1.th.jpg

для него надо:

#ndiv p {
font-size: 11pt;
font-family: verdana;
font-weight: bold;
color: #4a4a4a;
float: none;
}

2. var2d.th.jpg

для него:

#content {
border: 2px solid black;
margin: auto 200px auto 195px;
}
#ndiv p {
font-size: 11pt;
font-family: verdana;
font-weight: bold;
color: #4a4a4a;
float: none;
}

P.S. рамки делал разноцветные для себя, чтобы разобраться где какой блок.

Если что неправильно - скажите, только пытаюсь разобраться.

Link to comment
Share on other sites

  • 0

а еще я попробовал так:

#mdiv {
float: left;
width: 195px;
border: 2px solid black;
font-size: 10pt;
font-family:Verdana, Geneva, sans-serif;
font-weight: bold;
margin-right: 6px;
}



#content {
width: 580px;
border: 2px solid black;
float: left;
}

получилось тоже самое, есть ли разница как поступать? Или же какой то из способов приоритетный?

Edited by sv12
Link to comment
Share on other sites

  • 0

по-моему оба случая имеют право на существование,но если меняется ширина родительского блока в моем случае изменится ширина среднего блока (т.к. привязка к границам род. блока), а в вашем случае средний блок может либо залезть на соседние, либо останется разрыв (т.к. жестко задана его ширина).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Обсуждения

    • Актуальные контакты: Telegram: @Nikker_web E-Mail:   tarasevich.email@gmail.com Портфолио https://www.behance.net/d4d4186e Разрабатываю дизайн групп в соц сетях, сайтов, приложений, другой дизайн под заказ    
    • Актуальные контакты: Telegram: @Nikker_web E-Mail:   tarasevich.email@gmail.com   Разрабатываю дизайн групп в соц сетях, сайтов, приложений, другой дизайн под заказ   Портфолио https://www.behance.net/d4d4186e
    • Доброго всем времени суток. Прошу помощи. Научите принципу изменения футера. Движок Xenforo. Версия 2.2.10. Стиль дефолтный. Что именно нужно в итоге на фото примере. Мой шаблон app.footer less имеет следующее значение.  .p-footer { .xf-publicFooter(); a { .xf-publicFooterLink(); } } .p-footer-inner { .m-pageWidth(); .m-pageInset(); padding-top: @xf-paddingMedium; padding-bottom: @xf-paddingLarge; } .p-footer-row { .m-clearFix(); margin-bottom: -@xf-paddingLarge; } .p-footer-row-main { float: left; margin-bottom: @xf-paddingLarge; } .p-footer-row-opposite { float: right; margin-bottom: @xf-paddingLarge; } .p-footer-linkList { .m-listPlain(); .m-clearFix(); > li { float: left; margin-right: .5em; &:last-child { margin-right: 0; } a { padding: 2px 4px; border-radius: @xf-borderRadiusSmall; &:hover { text-decoration: none; background-color: fade(@xf-publicFooterLink--color, 10%); } } } } .p-footer-rssLink { > span { position: relative; top: -1px; display: inline-block; width: 1.44em; height: 1.44em; line-height: 1.44em; text-align: center; font-size: .8em; background-color: #4682B4; border-radius: 2px; } .fa-rss { color: white; } } .p-footer-copyright { margin-top: @xf-elementSpacer; text-align: center; font-size: @xf-fontSizeSmallest; } .p-footer-debug { margin-top: @xf-paddingLarge; text-align: right; font-size: @xf-fontSizeSmallest; .pairs > dt { color: inherit; } } @media (max-width: @xf-responsiveMedium) { .p-footer-row-main, .p-footer-row-opposite { float: none; } .p-footer-copyright { text-align: left; padding: 0 4px; // aligns with other links } }  
    • Нужны сайты с примерами верстки, типа https://css-tricks.com/. Типовые приемы и нестандартные на все случаи жизни. Накидайте ссылок.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy