Jump to content
  • 0

Проблемы с div


Ramone
 Share

Question

Вот начитался статей про div и понял что пора бы уходить с тейблов)))

Возникла небольшая проблемка, не могу растянуть div внутри другого diva.. в общем вот код..

Вот код шаблона (сайт на жумле будет):

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru">
<head>
<title>Trying to use CSS</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>

<div id="header">HEADER</div>
<div id="tmenulimg"></div>
<div id="tmenu">Top Menu must be there</div>
<div id="search">
<div id="tmenurimg"></div>
<div id="tmenufind">Search module must be there</div>
</div>
<div id="breadcrumbs">Breadcrumbs</div>
<div id="leftmodule">There must be Left Menu and maybe something else</div>
<div id="content">
<div id="rightmodule">Quizes and other farts</div>
<div id="contentw">News, articles, video, etc.</div>

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

CSS:

html, body {
margin:0;
padding:0;
border-left: 6px #558694;
border-style: solid;
border-top: 0px;
border-right: 0px;
border-bottom: 0px;

background: url(images/bg.jpg) repeat-x;
background-color: aaaaaa;
}

#header {
height:150px;
width: 100%;
}

#tmenulimg {
width:46px;
height:42px;
float:left;
background-image: url(images/tmenulimg.jpg);
}

#tmenu {
width:440px;
height:42px;
float:left;
background:#cee7e7;
}

#search {
min-width:300px;
}

#tmenurimg {
width:46px;
height:42px;
float:right;
background-image: url(images/tmenurimg.jpg);
}

#tmenufind {
min-width:300px;
height:42px;
margin-right: 42px;
float:left;
background: url(images/tmenubg.jpg) repeat-x;
}



#breadcrumbs {
margin-left: 200px;
clear:both;
}

#leftmodule {
width:190px;
margin-top:20px;
float:left;
background:#FFC597
}

/* Content and Right module part */
#content {
min-width:550px;
margin-left: 190px;
}

#rightmodule {
float:right;
width:190px;
margin-top:20px;
background:#FFC597
}

#contentw {
margin-right: 190px;
}
/* End of Content and Right module part */

Проблема возникает с частью tmenufind и contentw. Мне нужно чтобы они растягивались на 100% внутри остальных div`ов.

Помогите пожалуйста.

Заранее благодарю!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

<div class="parant">
<div class="children"></div>
</div>

.parant{background:#666;width:500px;height:300px}
.children{backgound:#333;height:100px}

В данном случае блок children сам растянется на ширину родителя, т.е на 500px.

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

×
×
  • 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