Jump to content
php.lv forumi

Par div bez height


spuris

Recommended Posts

kādā ziņā "norīts"? Parādi visu css ruli.

Varbūt z-index jāpalielina.

 

Paldies, atkodu pats! :)

 

Nācās pārstrādāt kodu, jo atradu internetā, ka šāda kostrukcija nav iespējama - viens divs iekš cita un abiem nav height norādīts...

Link to comment
Share on other sites

Kāpēc tad nav iespējama? Ja vien nav overflow:hidden.

 

<!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>

 

<style type="text/css" media="screen">

 

#Zero {

 

background-color: red;

height: 100px;

position: relative;

 

}

 

#One {

 

background-color: black;

position: relative;

 

}

 

#Two {

 

background-color: blue;

width: 300px;

height: 100px;

top: 400px;

left: 100px;

position: absolute;

 

}

 

#Three {

 

background-color: green;

height: 100px;

position: relative;

 

}

 

</style>

 

</head>

 

<body>

 

<div id="Zero"></div>

 

<div id="One">

 

<div id="Two">

 

<p>Hello!</p>

 

</div>

 

</div>

 

<div id="Three"></div>

 

</body>

 

</html>

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.

Guest
Reply to this topic...

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

Loading...
×
×
  • Create New...