Jump to content
php.lv forumi

divi <div> vienaa <divaa>(ar centreshanu)


Sephy

Recommended Posts

tatad problema tada ka labais divs(right1) nokrit uz leju!!! vjag lai vinsh paliek turpat kur ir divs ar nosaukumu left1

kods:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>  
 <head>  
   <meta http-equiv="content-type" content="text/html; charset=windows-1250">  
   <meta name="generator" content="PSPad editor, www.pspad.com">  
   <link rel="stylesheet" type="text/css" href="./main.css">  
   <title>
   </title>  
 </head> 
 <body>           
   <div id="main">    
     <div id="left">                 
       <div id="first">
         <div id="left1">
         </div>
         <div id="right1">
         </div>
       </div>             
     </div>
     <div id="right">           
     </div>        
   </div>     
 </body>
</html>

 

un css:

 

/* CSS Document */

html{
height:100%;
width:100%;
}

body{
height:100%;
width:100%;
margin:0px;
padding:0px;
}

#main{
height:100%;
width:100%;
background-color:blue;
}

#left{
position:relative;
width:70%;
float:left;
height:100%;
background-color:purple;
}



#first{
width:100%;
position:absolute;
height:475px;
background-color:red;
}

#left1{
margin: 0 auto;
text-align: left;
height:100%;
width:496px;
background-color:black;
}


#right1{

border:solid 3px green;
z-index:11;
float:right;
height:100%;
width:28px;
background-color:white;
}

#right{
float:right;
height:100%;
width:30%;
background-color: yellow;
}

Link to comment
Share on other sites

tad nodefinee:

 

#left1{

float:left}

 

Man jaut, tu veel sarezhgjiitaaku kodu nevareeji uzraxtiit ?! Tu pats vari paskaidrot, kam tev vajag visus position:relative, absolute un z-indexus ?

Link to comment
Share on other sites

tad nodefinee:

 

#left1{

float:left}

 

Man jaut, tu veel sarezhgjiitaaku kodu nevareeji uzraxtiit ?! Tu pats vari paskaidrot, kam tev vajag visus position:relative, absolute un z-indexus ?

ja nodefinaa float;left tad vairak necentrejas mans left1. tos z indexus un positionus var pagaidam nenemt veraa jo man vel pec tam tur bus jaliek 3 divs un tura ar shie noderes

Link to comment
Share on other sites

Bet tev buutu stipri jaapiedomaa pie code vienkaarshoshanas, naf tev #main vajag vispaar? bg tu vari nodefineet arii body un buus tev fons zils.

tas ir taikai pagaidam lai redzetu kur mani lauki salikushies(vai pareizajaas vietaas)

Link to comment
Share on other sites

Lai redzētu kur lauki(elementi) izvietojušies izmanto border: 1px solid red. Katram elementam savādāku krāsu liec. Un kad esi beidzis vienkārši uzliec vieninieka vietā nulli! Ja viss iet baigi precīzi, neaizmirsti ņemt vērā šo 1 px, kas iespaidos platumu un augstumu.

Link to comment
Share on other sites

×
×
  • Create New...